views:

561

answers:

1

I would like to ask how can i display Japanese text in Eclipse properly. I work in Japan and the code we have has a lot of Japanese characters. I just notice that for .java and .jsp file, that all the Japanese comments and text are displayed properly as Japanese. However, for other filesm such as js (Javascript) file or inc (include) file that the Japanese charctyer are not displayed properly.

I already checked the settings and the text is set to MS932 encoding. Which I think is the Shift-JIS encoding for Japanese text. Any ideas?

+1  A: 

Few things come to mind

  • Files might be encoded with UTF-8 instead of SJIS
  • Eclipse might be using a different font for the files with no kana support
  • You say you checked the encoding, but did you check the file itself, or Eclipse's chosen encoding for them? Could be a mismatch.

You could try asking your japanese colleagues. I'm sure they've encountered this more than few times.

Jani Hartikainen
Thanks, but here is what I noticed. All the java and jsp has their encoding set to UTF-8 but the default is MS932. I am not sure why they are set to UTF-8 automatically. Then all other file extension had their encoding set to MS932. I tried changing the Resource property to UTF-8 but I am wondering why it defaults to UTF-8 for some and not to all by default?
Nassign
Most likely a convention of the language/operating system. For example, Windows does not use UTF-8 for its files by default, yet XML and Java code tends to be UTF-8 encoded. Eclipse guesses that you want to follow the convention and uses the charset automatically.
Jani Hartikainen