This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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
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.
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.