Re: [gtk-list] locales deslocalized?
- From: Owen Taylor <otaylor redhat com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] locales deslocalized?
- Date: 19 Jan 2000 09:33:41 -0500
Antonio Campos <acampos@ceronet.com> writes:
> I repost this mail in the hope of an answer.
> The post has to do with the the inability of a GtkEntry for correctly
> selecting spanish characters, even when locales are correctly set.
>
> Owen Taylor said me that I had set the correct locale. And my answer
> was:
>
> "After your answer I read a little about locales through the info
> system.
> When I execute gtk programs, the locale command gives the following:
> LANG=es
> LC_CTYPE="es"
> LC_NUMERIC="es"
> LC_TIME="es"
> LC_COLLATE="es"
> LC_MONETARY="es"
> LC_MESSAGES="es"
> LC_ALL=
> So I think the locales are correctly set.
This doesn't mean anything. Try LANG=foobarbaz locale.
You are running into a problem people frequently encounter.
When looking up locales, locale names are never lengthed,
only shortened. So you can't get from es to es_ES. And
GNU libc does not include an es locale -- it only includes
an es_ES locale.
> That induced me to investigate a little further. I made the following
> program:
>
> #include <stdio.h>
>
> void main()
> {
> char c='Ñ';
>
> if (isalpha (c))
> fprintf (stderr,"The character `%c' is alphabetic.\n", c);
> }
>
> With exactly the same locale configuration as before, the program didn't
>
> produce any output (and that wasn't supposed to occur).
If you include locale.h and call setlocale(LC_ALL, "") at the
top of your program, and use a settting of LANG=es_ES, I think
you'll see more what you expect. Havoc's comments about gtk_set_locale()
and gnome_init() are accurate. (Also, make sure to check to see
if you have a LC_ALL environment variable set, since that
overrides LANG)
[...]
> Maybe UNICODE will finish all these silly problems?. I hope so :^)"
It will make things somewhat better. Though the need for locale
settings will not go away, for things like translating messages,
printing dates, ordering text, etc.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]