0
  • I have a line with the word "Tác" in a UTF8 saved file. (Special Character á)
  • I read the file in Java as follow :

    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileDir), "UTF8"));

  • In Eclipse Debugmode my Value of the word I fetch from the File is T�c !

  • When inserting into my SQlite DB the same -> T�c

  • In my existing SQLite-DB already exists entries with special characters like "Concepción"

Additional Info : Writing System.out like follow :

                    PrintStream out = new PrintStream(System.out, true, "UTF-8");
                out.println(sSitename);

results in: T�c

Anyone do have a hint how I can solve this problem ?

mcfly soft
  • 11,289
  • 26
  • 98
  • 202

1 Answers1

1

Sounds like its not really reading out in UTF8, have you tried "UTF-8"?

Check out the Charset documentation.

Noah
  • 1,966
  • 1
  • 14
  • 29
  • Yes it looks like its not reading UTF8. The Question is howto read a saved UTF8 File ? Or What am I doing wrong ? See I use the "UTF8" Parameter in InputStreamReader. – mcfly soft Dec 03 '13 at 15:49
  • I mean, try this: BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileDir), "UTF-8")); – Noah Dec 03 '13 at 15:55
  • Thanks for helping, but its the same result. I see your point with '-' I missed perhabs, but the same result. – mcfly soft Dec 03 '13 at 15:57
  • Check out this question: http://stackoverflow.com/questions/16435525/how-to-read-utf-8-encoded-file-in-java-with-turkish-characters – Noah Dec 03 '13 at 15:59
  • Sorry my fault ! The File was in ansi after copying the file into my vmware instance. I do not understand why, but on my local instance it is UTF8 , after dragging the file into the vmware instance the file is ansi, but I see the special characters correct. After saving as UTF-8 it works perfect. Thanks aniway. – mcfly soft Dec 03 '13 at 16:22