8
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

vim-quickrunでjavacの出力が文字化けするのを直す

terminalでの文字化けは

alias javac = javac -J-Dfile.encoding=UTF8

で治せるが,vim-quickrunの場合はvimrcへの設定が必要

.vimrc
let g:quickrun_config["java"] = {
      \ 'exec' : ['javac -J-Dfile.encoding=UTF8 %o %s', '%c %s:t:r %a']
\}

参考:vim-quickrun

追記(2014/3/6)

コンパイルだけじゃなくて,実行時にもオプションが必要だった.

terminalの場合は

alias javac = javac -J-Dfile.encoding=UTF8
alias java  = javac -Dfile.encoding=UTF8

vimrcは

.vimrc
let g:quickrun_config["java"] = {
      \ 'exec' : ['javac -J-Dfile.encoding=UTF8 %o %s', '%c -Dfile.encoding=UTF8 %s:t:r %a']
\}

とします.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
8
Help us understand the problem. What are the problem?