Re: Can't see accents through putty (181 Views)
Reply
Occasional Visitor
Exhortae
Posts: 2
Registered: ‎12-16-2013
Message 1 of 5 (224 Views)

Can't see accents through puty

Hi,

 

I have an HP-UX 11.23 box where I have added to a user .profile the following lines:

 

export LANG=fr_FR.utf8

export LC_ALL=fr_FR.utf8

 

 

when I execute this command :

 

locale

 

 

I get the following output :

 

LANG=fr_FR.utf8

LC_CTYPE="fr_FR.utf8"

LC_COLLATE="fr_FR.utf8"

LC_MONETARY="fr_FR.utf8"

LC_NUMERIC="fr_FR.utf8"

LC_TIME="fr_FR.utf8"

LC_MESSAGES="fr_FR.utf8"

LC_ALL=fr_FR.utf8

 

 

I connect to this server with putty (the remote character set is set to utf8)

 

As soon as I'm connected, if I type the charactère é or è (something with accents) I get awkward values like )C

 

 

I have spend the day on it with no luck, if anyone can help ?

 

Thank you

 

 

 

Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,199
Registered: ‎05-29-2000
Message 2 of 5 (207 Views)

Re: Can't see accents through puty

One of the most challenging aspects of special characters that are not part of the ASCII collection is how to represent the 'other' characters. Although HP-UX offers locales to attempt to standarize the methods, PuTTY implements a fairly narrow range of font extensions but doesn't offer any standard names for the extensions. I would try changing the 'Script' dropdown box found in the Window -> Appearance -> Change option. It looks like "Central European" may be a match.

Please use plain text.
Occasional Visitor
Exhortae
Posts: 2
Registered: ‎12-16-2013
Message 3 of 5 (195 Views)

Re: Can't see accents through puty

Hi,

 

 

No it didn't work.

 

 

What is strange is that in putty under the login prompt when I type a character with accents it works like : login:éééé

 

 

 

but as soon as I'm logged in, when I type é it is replaced by C)

 

 

Thanks

Please use plain text.
Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 4 of 5 (186 Views)

Re: Can't see accents through puty

Your shell and/or stty settings might be stripping off the 8th bit on accented characters, but the login prompt is 8-bit clean and echoes everything back as-is.

 

When UTF-8 encoding is used and the 8th bit is stripped off from non-US-ASCII characters, you get a random-seeming group of two or more US-ASCII characters for each non-US-ASCII character.

 

Things to check:

 

- stty settings: run "stty -a" to check. You'll want "-parenb", "cs8", and "-istrip". Note the minus signs. If your "stty -a" output says "istrip" without the minus sign, run "stty -istrip" to fix it for the current session. You can add this to /etc/profile or your personal login script.

 

- shell: At least on some HP-UX versions, the default shell /usr/bin/sh supports locales, but only if the locale variables are already set up when the shell starts up... and if the locale variables are set in /etc/profile, the shell is already running when the variables are set.

 

To test for this, first make sure that your stty settings and locale variables are correct, then run "exec $SHELL". If this fixes it, note that you cannot just add this into /etc/profile without causing an endless loop.

 

Alternative ways to get around this problem:

  • use another shell: for example, /usr/bin/ksh seems to handle the locale environment variables in a smarter way (i.e. it detects changes to locale environment variables in the current session and makes the appropriate setlocale() calls for itself).
  • if you are logging in with SSH, make sure that PermitUserEnvironment is set in /opt/ssh/etc/sshd_config, and put the locale environment settings to $HOME/.ssh/environment file: the sshd daemon will read the file and set the variables before actually starting your shell, so localized /usr/bin/sh will work.
MK
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,854
Registered: ‎03-06-2006
Message 5 of 5 (181 Views)

Re: Can't see accents through putty

>Alternative ways to get around this problem:

 

You could just exec the shell again.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation