• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cyrillic alphabet in eclipse

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so, how to solve this issue? thanks
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried


got the block char again instead of あ
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


this piece of code printed block char in the eclipse console. thanks
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic