Unix administration - Session encoding/language

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > May 2006 > Session encoding/language





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Session encoding/language
allab@sympatico.ca

2006-05-02, 1:20 pm

Hello everyone,

Is there a way to set session encoding not through a desktop session?

Can session encoding be modified through configuration file so that
when a user logs in through telnet s/he can create files with
non-english names.


Thank you,
Alona

Michael B. Trausch

2006-05-02, 7:19 pm

allab@sympatico.ca wrote in
<1146590536.653960.54580@v46g2000cwv.googlegroups.com> on Tue May 2 2006
13:22:

> Hello everyone,
>
> Is there a way to set session encoding not through a desktop session?
>
> Can session encoding be modified through configuration file so that
> when a user logs in through telnet s/he can create files with
> non-english names.
>
>
> Thank you,
> Alona


You may or may not be addressing more then one point in there, that I don't
know. I'll address what I can.

The encoding that the terminal expects is set by the LANG shell variable.
To get valid values for LANG, run:

$ locale -a | grep -i en

To get valid English locales that are installed on the system (if you want
things in different messages, change 'en' to whatever two character
language designation you're looking for):

[0:af/f/fd0man> locale -a | grep -i en
en_AU.ISO8859-1
en_AU.ISO8859-15
en_CA.ISO8859-1
en_CA.ISO8859-15
en_GB.ISO8859-1
en_GB.ISO8859-15
en_US.ISO8859-1
en_US.ISO8859-15
en_US.UTF-8
[0:af/f/fd0man>

In my case, I wanted UTF-8, so I set my LANG in my .profile:

[0:af/f/fd0man> cat .profile | grep LANG
export LANG=en_US.UTF-8
[0:af/f/fd0man>

To confirm that it works, log out, log back in, and then type 'locale':

[0:af/f/fd0man> locale
LANG="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=""
[0:af/f/fd0man>

Some systems will set all of those things for you. You should then be able
to enter things like é and Ä on the bash command line.

However, note that not all of the applications that you may use on the
system may be aware of the encoding in use. For example, when you type a
UTF-8 character in Emacs when the terminal encoding is UTF-8, but the
currently running Emacs doesn't have UTF-8 support, you see:

e accented: é
copyright: ©
a dotted: ä
c ced: ç
C ced: Ã

Which, as you can see, are not correct. Also, if it doesn't speak UTF-8,
the filenames that have foreign characters in them may get mangled. If the
entire system supports UTF-8 though, you're all set.

However, keep in mind that the client system must be able to support the
characters being entered. i.e., if I can't type "en français" on my
keyboard, then no matter what the session encoding is, that c cedilla
character isn't going to make it in there.

- Mike
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com