Encoding problems (questions?)

Answered

 I'm trying to understand how all these encoding 'things' work .

'Life cycle' from source file encoding to output at console. Right?:

1) Encoding src file . For Example UTF-8

2) Next java compiler needs to know encoding format of src file . To compile that) . If i type like that "javac test.java". So compiler understands (i dunno how) that this file is utf-8 and next we get .class file with inner JAVA encoding format (byte format?) .

3) Now we need to run that via  'java test'. In that moment Java interpreter use system property 'File.Encoding' . For WIN RU system default - cp 1251. File encoding means what charset JVM will be use for output ??

4) If i want to see at my console some russian words - i use method 'println'. But for WIN RU console encoding - cp 866. So i can't understand why i can read characters via cp 866 console encoding format if JVM output encoding - cp 1251 .?? I think my problem is (except of knowledge of English ;) ) incomprehension of 'life cycle' encoding formats from src file to consle output

P.S. sry for english guys ;pp

 





0

Please sign in to leave a comment.