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ä

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:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

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

Revision history for this message
ari niemelä (ari5protonmailcom) said :
#2

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.