Java, Software Development

How to Read UTF-8 Encoded Files


This article demonstrates how to read files written in various logographic characters like Kanji (from Japan), Hanja (from Korea), and Hanzi (from China) using UTF-8 encoding.

Hardware Environment


Software Environment

  • Windows 7 Professional SP1
  • Eclipse – Kepler Release
  • Java 1.7 (1.7.0_67 – Windows x86)

First things, first – for Eclipse

By default, Eclipse does not use UTF-8 encoding to display logographic characters. With that setting, “????” characters are displayed instead. To avoid them, change Eclipse file encoding to UTF-8 as shown on the image below.


The Codes to Read UTF-8 Encoded Files

Sample Output


Get Codes from GitHub

Got comments, or suggestions? Please visit our Facebook page!

You Might Also Like