Class DataInputStream is the wrong thing to use when reading from a
text file. As the documentation says, class DataInputStream is meant for reading primitive
Java data types from an underlying input stream, and readUTF() uses some kind of modified UTF-8 format (not the standard UTF-8 format).
For reading from text files,
you should use a Reader. The various Reader classes that exist in java.io (for example BufferedReader, InputStreamReader, FileReader etc.) take care of converting data from an input stream to text, using a character encoding.
To read a text file in UTF-8 encoding, try this: