aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes cyrillic alphabet in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "cyrillic alphabet in eclipse" Watch "cyrillic alphabet in eclipse" New topic
Author

cyrillic alphabet in eclipse

Andrew Cane
Ranch Hand

Joined: Aug 07, 2013
Posts: 91
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
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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

Joined: Aug 07, 2013
Posts: 91
so, how to solve this issue? thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

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).


Customer surveys are for companies who didn't pay proper attention to begin with.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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

Joined: Aug 07, 2013
Posts: 91
I tried


got the block char again instead of あ
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

And what does "got" mean in that context? Can you explain what you did and where you saw the block?
Andrew Cane
Ranch Hand

Joined: Aug 07, 2013
Posts: 91


this piece of code printed block char in the eclipse console. thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cyrillic alphabet in eclipse