Java: Unicode in Source Code

By Xah Lee. Date: . Last updated: .

File Encoding

When saving file, make sure you save it as UTF-8 encoding. Your editor should have a option to do so. [see Set Text Editor File Encoding]

If you have errors in compiling, try

javac -encoding UTF8 filename

[see Unicode Basics: Character Set, Encoding, UTF-8]

Java, Unicode