Java uses Unicode
Unicode can be serialized in a variety of formats
UTF-8
UCS-2
UCS-4
Most files are in still some other encoding
ASCII
Latin-1
MacRoman
etc.
When you read and write text you must pay attention to character sets.