SunnyX
asked on
JVM encoding. How to change encoding.
To make story short, I simplify my case as much as possible.
Please take a look on this share pic
https://gyazo.com/cfea9042b2b2d9f7f8959de7c2913055
Please tell me what I'm doing wrong. I use encoding codes from this table
http://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_Languages
For example I need Albanian.
The restriction is that no source code changes allow.
Please take a look on this share pic
https://gyazo.com/cfea9042b2b2d9f7f8959de7c2913055
Please tell me what I'm doing wrong. I use encoding codes from this table
http://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_Languages
For example I need Albanian.
The restriction is that no source code changes allow.
ASKER
If shortly, in command line :
I change chcp on 1250
makes: javac myClass.java
makes: java myClass
and still haven't good letters
in my output
I change chcp on 1250
makes: javac myClass.java
makes: java myClass
and still haven't good letters
in my output
ASKER
C:\Users\***\*** Drive\*** development\*** all\***\dev\projects\***\* \src\main\ java>chcp
Active code page: 437
C:\Users\*****\*** Drive\*** development\*** all\***\dev\***\***\*\src\ main\java> chcp
1250
Active code page: 1250
C:\Users\***\**** Drive\Software development\*** all\***\dev\projects\***\* **\src\mai n\java>chc p
Active code page: 1250
C:\Users\***\Google Drive\Software development\myGJJ
all\GJJRepoAlgoLevelTwo\de v\projects \getjavajo b\algo\src \main\java >java com.***.***.***.***.***
.HelloWorldAlbanian
P???rsh???ndetje bot???!
C:\Users\***\*** Drive\*** development\*** all\***\dev\projects\***\* **\src\mai n\java>
Active code page: 437
C:\Users\*****\*** Drive\*** development\*** all\***\dev\***\***\*\src\
1250
Active code page: 1250
C:\Users\***\**** Drive\Software development\*** all\***\dev\projects\***\*
Active code page: 1250
C:\Users\***\Google Drive\Software development\myGJJ
all\GJJRepoAlgoLevelTwo\de
.HelloWorldAlbanian
P???rsh???ndetje bot???!
C:\Users\***\*** Drive\*** development\*** all\***\dev\projects\***\*
That's not an answer to the question i asked. In fact it really repeats information you have already given
ASKER
Error: Could not find or load main class Props
ASKER
....\dev\projects\***\algo\src\main\java\com\***\***\***\***\***>java Props file.encoding
Error: Could not find or load main class Props
Did you download and compile the Java source at the link?
Actually, this is too painful - we can leave the question of what encoding you are using as a mystery for future solution
Open a new cmd.exe window and run your code like this:
Open a new cmd.exe window and run your code like this:
java -Dfile.encoding=windows-1252 WhateverYourClassIs
ASKER
The same garbage output...
P�rsh�ndetje bot�!
P�rsh�ndetje bot�!
ASKER
-Dfile.encoding ... seems make no difference at all
when I change chcp on 65001
the output is:
P�rsh�ndetje bot�!
However, when I do Dfile.encoding=windows-650 01 the output is P�rsh�ndetje bot�! ( like the first one )
I even, by mistake, write down Dfile.encoding=windows-650 02 and cmd throw the same garbage P�rsh�ndetje bot�!
However, by logic it should throw exception instead...
but the cmd didn't tell me that there is any mistake ( like "Invalid code page" like chcp doing )
btw, I use Windows 10
when I change chcp on 65001
the output is:
P�rsh�ndetje bot�!
However, when I do Dfile.encoding=windows-650
I even, by mistake, write down Dfile.encoding=windows-650
However, by logic it should throw exception instead...
but the cmd didn't tell me that there is any mistake ( like "Invalid code page" like chcp doing )
btw, I use Windows 10
ASKER
and yes I switch on lucida console
Actually i now DO need the output i asked for HERE so please compile and run Props.java in the way i showed
And you didn't post the source for HelloWorldAlbanian as i requested
So have you tried code pages
1252
and also ISO
8859-1
8859-2
8859-9
8859-15.
1252
and also ISO
8859-1
8859-2
8859-9
8859-15.
ASKER
And you didn't post the source for HelloWorldAlbanian as i requested
Sorry,
Here the source code.
package com.g*********.***.al***.***.l***;
/**
*/
public class HelloWorldAlbanian {
public static void main(String[] args) {
System.out.println("P�rsh�ndetje bot�!");
}
}
Actually i now DO need the output i asked for HERE so please compile and run Props.java in the way i showed
I'm so sorry. I really wanna give you output from the
java Props file.encoding
But once again it gives me nothing when I try to compile the code as I post before HERE Are you sure that this is valid command ? in which folder should I run it ??? May be I made mistake by running the command in wrong folder. Because you know there is a difference between running java and javac require different folders for example ( because of the packages ) like it mention in https://javarevisited.blogASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
btw, I generate .class file by using this command in cmd
and beforehand I change chcp on 1252 too
javac -encoding Windows-1252 MyClass.java
and beforehand I change chcp on 1252 too
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Okey I'm done. Now everything fine. The solution was I need to reload file after I change encoding in ide.
https://gyazo.com/8b6da5f005c2a1ed7fd5c04046568956
after than I generate new .class file with chcp 1252 and everything good now ! thx for your time
https://gyazo.com/bbd0c35832f91a46537eed7ad77e51b9
https://gyazo.com/8b6da5f005c2a1ed7fd5c04046568956
after than I generate new .class file with chcp 1252 and everything good now ! thx for your time
https://gyazo.com/bbd0c35832f91a46537eed7ad77e51b9
ASKER
Thx a lot !
OK. btw afaics there's absolutely nothing special about Albanian. The standard code pages /encodings should do it fine
1252 eh? Rings a bell.
Sunnyx are you friends with guddi9?
@gurpsbassi
Are you suggesting a Romano-Latin axis ?
I also think , CEHJ, that Albanian does have special alphabetic elements not present in other languages.
Are you suggesting a Romano-Latin axis ?
I also think , CEHJ, that Albanian does have special alphabetic elements not present in other languages.
I also think , CEHJ, that Albanian does have special alphabetic elements not present in other languages.Not sure what you have in mind but the OP's own link at http://scratchpad.wikia.com/wiki/Character_Encoding_Recommendation_for_Languages shows that windows-1252 (default in the UK) can cope with Albanian, so i don't see how they could be particularly exotic ;)
The webpage SunnyX uses then must be wrong, would you say? Albanian does not figure in the 1252 table that I came upon elsewhere.
a. there's no need to link to external sites - it's quite possible to post images directly on this one
b. in most cases you want to copy from cmd.exe and paste here (see below)
Please post the output of the following
Open in new window
See ( http://technojeeves.com/index.php/aliasjava1/16-javasystemproperties )
Oh and it might help to post the code of that HelloWorld too