The problem is most likely where you read, write and / or show these characters.
If you are reading these characters using Reader , you first need to create an InputStreamReader using a 2 argument, in which you can pass the correct encoding (thus UTF-8 ) as the second argument. For instance.
reader = new InputStreamReader(url.openStream(), "UTF-8");
If you, for example, write these characters to a file, you need to build an OutputStreamWriter using a 2-argument constructor, in which you can pass the correct encoding (thus UTF-8 ) as the second argument. For instance.
writer = new OutputStreamWriter(new FileOutputStream("/page.html"), "UTF-8");
If you, for example, write all the standard vanilla in stdout (for example, System.out.println(line) , etc., then you need to make sure that stdout itself uses the correct encoding (thus, UTF-8 ). IDE, for example Eclipse, you can configure it using the window> Settings> General> Workspace> Encoding.
source share