Java Cookbook
unicode
Problem:
You want to read a Unicode encoded file into memory.
Solution:
To read a file with a charset other than the system default you should specify the charset in the reader. You can specify either a Charset or the String id of the Charset.
To read a Unicode file containing Japanese characters:
Problem:
You want to display Japanese, Chinese, or other Unicode characters in the Eclipse console.
Solution:
By default the eclipse console does not handle Unicode. All Unicode characters in the Eclipse console are replaced by question marks. Luckily it is a simple matter to get Unicode characters to display. You will need to make two simple modifications to the run dialog.
If you are testing any of these recipes in Eclipse and the characters are not displaying correctly in your console visit http://i18ncookbook.com/eclipse_settings.
This site is ad supported. I hope you find something among our sponsors worth clicking. ;)
i18n search