D
D
DVamp1r32013-09-15 23:56:05
Java
DVamp1r3, 2013-09-15 23:56:05

Java, Windows console, encodings?

I'm writing a GUI to work with ADB. When receiving a list of folders, all characters (Russian) are displayed "as needed". But when transferring the same characters (going to a subdirectory), I get the message "No such file ...". The output to the console of Russian characters in the best traditions of Windows is kryakozyabry.
Question 1: will everything be solved by converting (Unicode -> CP866) arguments before passing them to the process?
Question 2: Are there such pitfalls in other operating systems? As far as I know, in the same Linux, the console is unicode.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
@
@xave, 2013-09-16
@DVamp1r3

Question 1: will everything be solved by converting (Unicode -> CP866) arguments before passing them to the process?

if the console is in cp866, then yes.
Question 2: Are there such pitfalls in other operating systems? As far as I know, in the same Linux, the console is unicode.

In the overwhelming majority, yes, but there is a non-zero chance of running into some kind of retrograde machine with koi8-r installed to save bytes.

C
CAMOKPYT, 2013-09-16
@CAMOKPYT

you can try to convert the console to UTF8 with the chcp 65001 command

D
DVamp1r3, 2013-09-16
@DVamp1r3

del

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question