LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Jre 1.4.2 locale problem (https://www.linuxquestions.org/questions/linux-software-2/jre-1-4-2-locale-problem-152934/)

GruiX 03-03-2004 04:46 AM

Jre 1.4.2 locale problem
 
Hi,

I'm french and i often use Java Applets to chat
But, i can't use accents and special french characters (éàùçêô...) into those applets :/
it's quite sucking..

Thanks

MunterMan 03-03-2004 06:56 AM

That means the java is badly written.
If you are writing them yourself, use the locale class.

see here
http://java.sun.com/j2se/1.4.2/docs/...il/Locale.html

GruiX 03-03-2004 07:37 AM

It's not my applets.. Have you never seen one of these java applet that connect to an IRC chan (for exemple)?

Sure, their applets are badly written but i can't do anything for this..


I saw there was a "ControlCenter" applet given with JRE in which we can specify parameters for all applets the JVM runs.. Maybe, here is the solution.. But i don't know which parameter i should put there.. The help talks about "assertions" but i don't know how it works and if it could resolve this.


Or perhaps, the problem comes from my system locale configuration...

MunterMan 03-04-2004 06:41 AM

What encoding are your using?

I assume you are using a browser to look at the applets.
I am using opera. Under the view menu the encoding is set to automatic and your French characters don't show properly. If I set it to ISO-8859-1 (Western), they appear.

Java should use getLocale to get your location from the system. Have you set your location correctly?

If you have set the default keyboard layout and language as English, you should note that there is a difference between English (US) and English (International).

Hope this helps.

GruiX 03-04-2004 08:16 AM

Yes my browser encoding was set to "Occidental (ISO-8859-1)"

Quote:

Originally posted by MunterMan
Java should use getLocale to get your location from the system. Have you set your location correctly?
How do I know if it's set correctly?
Like this?
Code:

~$ locale
It gives :

Code:

LANG=POSIX
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

It's strange, yesterday i tried to set LC_ALL to "fr_FR.iso885915@euro", and now it's reset to "POSIX" :/

MunterMan 03-04-2004 08:00 PM

The locale information is held in

/etc/sysconfig/i18n

You could try editing this to the settings you want,
or use the kde control centre to set country and language.

GruiX 03-05-2004 06:17 AM

/etc/sysconfig does not exists :/

In KDE, Country is already set to "France"

:scratch:

In the Java Applet ControlCenter's parameters, i added these arguments :
Code:

-Duser.language=fr -Duser.country=FR -Duser.variant=EURO
Now, when i dump System Properties in the Java Console, i have these lines :
Code:

user.country = FR
user.language = fr
user.variant = EURO


..But AWT/Swing Textfields still don't accept my accents :cry:

MunterMan 03-05-2004 08:52 AM

Try this then,

export LANG="fr"
export LC_ALL="fr"


To make the changes permanent add them to a shell startup file.
I tend to use rc.local which is under /etc/rc.d somewhere.

You can set all the LC variables to fr, posix is just the default.

Even if you don't have an /etc/sysconfig/ you will have the i18n file somewhere. Ask at the debian support site.

GruiX 03-06-2004 04:59 AM

Modifying those global variables does nothing..

I have resolved my problem by reconfiguring the Debian's "locales" package
Code:

# dpkg-reconfigure locales
And then i selected the default locale "fr_FR@euro"

After a reboot, many programs were in French, i had all special french characters available in the Konsole and also in java applets ^^

Why i didn't try this earlier?
Because, when i installed the "locales" package, i had already selected "fr_FR@euro"... why it hadn't be saved? i dunno.



Now I have a problem with fonts :/ In many dialog boxes, they are about 6pt..


Anyway, Thanks for you help.


All times are GMT -5. The time now is 03:04 PM.