• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cyrillic alphabet in eclipse

 
Andrew Cane
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have problem typing cyrillic and japanese character in my code using eclipse. Does anyone know how to solve this? I've set the text encoding in Windows->Preference->General->Workspace->Text File Encoding to UTF-8, and then Windows->Preference->General->Content Types->Text's default encoding to UTF-8 and the properties of the file also to UTF-8. Hell, I've also add the parameter
-Dfile.encoding=UTF-8 into eclipse.ini, and still can't type in this line of code:


in my editor, it will turn to a block character. how to solve this issue? thanks
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "block" character being a vertical rectangle which takes up the whole space where the character would otherwise be? If so, then that means your editor is using a font which can't render the character which you typed.
 
Andrew Cane
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so, how to solve this issue? thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pick a font that has Cyrillic glyphs. One easy way to find one is to bring up MS-Word (or Open/LibreOffice Writer or whatever) and use the "Insert Character" menu to bring up the extended characters dialog. The cyrillic characters follow the extended Latin characters when they are supported, so just keep picking fonts until you see the characters and you like the looks of that particular font. Then make that your working font for Eclipse. Don't forget to pay attention to the proportional-versus-fixed font requirements. Using a proportional font where you need a fixed one can make the display really hard to read.

Note that coding any extended character into a string literal isn't a good idea. It's better if you use the Unicode escapes if you can:


Better yet, code them in resources, where they can better support I18N and avoid untidy code listings:


That way all the problematic stuff is localized to one/small set of file(s).
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're also using Japanese characters (are those just katakana or are you using kanji as well?) I would recommend using a Unicode font.
 
Andrew Cane
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried


got the block char again instead of あ
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what does "got" mean in that context? Can you explain what you did and where you saw the block?
 
Andrew Cane
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this piece of code printed block char in the eclipse console. thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Menu: Help/Preferences=>General/Appearance/Colors and Fonts.

I think it's probably the "Console Font", which on my system is the very last one on the list.

Select Font/Edit, changed to a font that passes the test I described previously.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic