TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   Problem of accents in Java? (http://forums.techarena.in/software-development/1101392.htm)

Aarya 10-01-2009 01:08 PM

Problem of accents in Java?
 
Hello, I just installed the JDK 6 update 11 on my pc.
When I write a program and I met for example:

System.out.println (i + "Measure in kilometres");

St accents replaced with bizarre characters and cedillas too. Yet I installed Multilanguage Pack How to fix this problem?

JoeFrat 10-01-2009 01:14 PM

Re: Problem of accents in Java?
 
It is a concern for charset in your files. Java and javac compiler.

Your file. Java is recorded in a charset (probably UTF-8), and javac think it is registered in another (probably Latin-1).

Two possibilities:
- Register your. Java in Latin-1 (also known as ISO-8859-1) instead of utf-8.
- Javac say that the source files are in utf-8. (javac-encoding utf8 MaClasse.java)

Aarya 10-01-2009 01:15 PM

Re: Problem of accents in Java?
 
Quote:

Originally Posted by JoeFrat (Post 4172490)
It is a concern for charset in your files. Java and javac compiler.

Your file. Java is recorded in a charset (probably UTF-8), and javac think it is registered in another (probably Latin-1).

Two possibilities:
- Register your. Java in Latin-1 (also known as ISO-8859-1) instead of utf-8.
- Javac say that the source files are in utf-8. (javac-encoding utf8 MaClasse.java)

The command-encoding utf8-warning puts me and when I run the program there are always signs to place accents and the file is coded in ANSI and I do not have the option to record in Latin-1.
I work with Notepad + +.

Modifier 10-01-2009 01:16 PM

Re: Problem of accents in Java?
 
Quote:

Originally Posted by JoeFrat (Post 4172490)
It is a concern for charset in your files. Java and javac compiler.

Your file. Java is recorded in a charset (probably UTF-8), and javac think it is registered in another (probably Latin-1).

Two possibilities:
- Register your. Java in Latin-1 (also known as ISO-8859-1) instead of utf-8.
- Javac say that the source files are in utf-8. (javac-encoding utf8 MaClasse.java)

The response above is actually a solution But for more security you can also use the program which will transform native2ascii accents in coding intermediary (eg becomes \ u00e8). This is especially useful if you provided your sources to someone else who does not have the same editor you: imagine that your publisher or UTF8


All times are GMT +5.5. The time now is 08:58 PM.