0

First, I read from file. Reading is fine ő.

Then, I enter ő in console and if I compare them I got false. I want ő with console reading as well.

Edit: I use InputStream inp = new FileInputStream(file) for reading file.

junpet
  • 87
  • 3
  • 14

2 Answers2

0

Try using InputStreamReader(System.in, "ISO-8859-16") instead.

ISO-8859-15 does not contain the character ő but ISO-8859-16 does. Furthermore ő is code point 0151 in ISO-8859-16 which is the same code point as ö in ISO-8859-15 which explains your current result.

binoternary
  • 1,865
  • 1
  • 13
  • 25
  • I've tried before, but something weird happened. My code printed "ISO-8859-16" and I couldn't entry any data. – junpet Jun 18 '16 at 05:08
  • @junpet, show more of your code (how exactly are you reading data from the file and from the console, and how exactly are you comparing the results), otherwise it's difficult to help you. – binoternary Jun 18 '16 at 06:41
0

Just use windows-1250 encoding. (Java doesn't support ISO-8859-16.)

junpet
  • 87
  • 3
  • 14