I try to read my file within java application. The file is in UTF-16 format and I have problems with finnish characters like 'ö' and 'ä' i.e. F600 and E400.

Asked by ari niemelä on 2019-10-13

I try to read my file within java application. The file is in UTF-16 format and I have problems with finnish characters like 'ö' and 'ä' i.e. F600 and E400.
After I read file in raw format I can translate other characters using standard charset UTF-16LE by creating string with
"new String(rbytes, 0, rlength, StandardCharsets.UTF_16LE)". The finnish characters are replaced with '?'.
I run Ubuntu 19.04 in english with finnish keyboard.
Do I miss something from the environment ?
I use java se jdk1.8.10_101 and jre1.8.0_221 without special development environment.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
ari niemelä
Solved:
2019-10-20
Last query:
2019-10-20
Last reply:

I suggest you post on a Java forum too, they may be able to advise

Actually this is the outcome in Java when I use LC_ALL=C in Ubuntu. I made a script in order to find the encoding of input files in startup and it is often useful to use that setting with bash commands.