Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vi foreign characters 1

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
GB
hi all

i have o/s sun solaris 2.6 US american.

i have a file with french character such as the "è", example below:


DESCRIPTION = "Détails de l'imputation - Synthèse ou détail"

when i do a more on this file all is well, however when i dump it to printer or vi it all is pear shaped!!!

can anyone point me in the right direction.

do i need to install another character set, or something!!1

cheers in advance

sy
 
if you don't want to change your system locale from US/american, then you can export LC_ALL when needed:

# export LC_ALL=fr

Regards,

Carlos Almeida,
 
cheers cfsalmeida

sorry to be ignorant, but am i assuming that you can only be in one state at any one time. ie either french character set, or US character set.

ps. when I echo LC_ALL, from root i am returning nothing as this is not in root environment. shoutd it be, or must it be installed first??????

sy

 
well, yes its possible that LC_ALL isn't setup by default,I only mention "LC_ALL" because it set everything, you can use only LC_CTYPE if you want and leave the rest alone, use locale command to check values:

# locale
LANG=
LC_CTYPE=pt_PT.ISO8859-15
LC_NUMERIC=pt_PT.ISO8859-15
LC_TIME=pt_PT.ISO8859-15
LC_COLLATE=pt_PT.ISO8859-15
LC_MONETARY=pt_PT.ISO8859-15
LC_MESSAGES=C
LC_ALL=

also default locale is set in "/etc/default/init", don't forget to use other locale you need that locale package installed check for locale files in "/usr/lib/locale" directory.

Hope it helps,

Regards,
Carlos Almeida,



 
does this mean i can only have one character set at any one time?????

ie in state french or state us.

or can i set this in the profile for say a french user to be different than that of an us user
 
Well, "pt_PT.ISO8859-15" is mine (Portugal), it also should work with french characters, but the french one in Solaris 2.6 is "fr".

# LC_ALL=fr
# export LC_ALL
# locale
LANG=
LC_CTYPE="fr"
LC_NUMERIC="fr"
LC_TIME="fr"
LC_COLLATE="fr"
LC_MONETARY="fr"
LC_MESSAGES="fr"
LC_ALL=fr
# éè

Regards,

Carlos Almeida,
 
ok thank you!!!!

would it be possible to say have 2 users one french and one US. whereby user1 has LC_ALL=fr and user2 has LC_ALL=en

regards Simon
 
Yes, you can export "LC_ALL" or "LC_CTYPE", in e.g: user .profile, you only need check if the locale you are setting is installed by check "/usr/lib/locale".

Regards,

Carlos Almeida,
 
ours ir set to

LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

what is "C"
 
A value of "C" for locale specifies the traditional UNIX system behavior, in the "C" locale, or in a locale where the character type information is not defined, characters are classified according to the rules of the US-ASCII 7-bit coded character set, you can check what values are set with a current locale, i.e:

# LC_ALL=C
# export LC_ALL
# locale
LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES=C
LC_ALL=C

to check values afected by LC_TIME:

# locale -ck LC_TIME
LC_TIME
d_t_fmt="%a %b %d %H:%M:%S %Y"
d_fmt="%m/%d/%y"
t_fmt="%H:%M:%S"
t_fmt_ampm="%I:%M:%S %p"
...
...
what afects what:
LC_CTYPE affects the behavior of character handling functions such as isdigit() and tolower(), and multibyte character functions such as mbtowc() and wctomb().
LC_NUMERIC affects the decimal point character and thousands separator character for the formatted input/output functions and string conversion functions.
LC_TIME affects the date and time format as delivered by ascftime(), cftime(), getdate(), and strftime().
LC_COLLATE affects the sort order produced by strcoll() and strxfrm().
LC_MONETARY affects the monetary formatted information returned by localeconv().
LC_MESSAGES affects the behavior of dgettext(), gettext(), and gettxt().

Hope it helps,

Carlos Almeida,
 
Ahhhh....

All is now clear, thank you very much for your help on this........

We have now got it working with 2 users, set up the path in the users environment all fine.

Thanks Again

cfsalmeida
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top