Skip to contentSkip to conversation

correct approach to set up utf-8 locales?

DISCUSSION Florian Doersch 2 participants 2 messages Jul 21, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

I recently trying to set up a raspberry pi with yocto.
The basic image with meta-raspberrypi works, but I cant get locales working correctly. I always only have "posix" keyboard.

I tried setting

GLIBC_GENERATE_LOCALES="de_DE.UTF-8"
IMAGE_LINGUAS="de-de"

I also installed the packages

glibc-utils locales localedef

into my image, but that seems not to change anything.

$ locale -a

does have a "de_DE" (but not the UTF-8 one ...)

but its still unset:

$ locale

always outputs "POSIX"

Also the (usb) keyboard layout does not change.

What do I have to set so the getty has the correct default language?

I also have yocto on a zynq board, where I also can't figure out how to set the correct locale.

Thank you very much

Florian

#1 lore raw
Quoted 13 lines · Florian Doersch

Hi,

I recently trying to set up a raspberry pi with yocto. The basic image with meta-raspberrypi works, but I cant get locales working correctly. I always only have "posix" keyboard.

I tried setting

GLIBC_GENERATE_LOCALES="de_DE.UTF-8"
IMAGE_LINGUAS="de-de"

I also installed the packages

Quoted 7 lines

glibc-utils locales localedef

into my image, but that seems not to change anything.

$ locale -a

does have a "de_DE" (but not the UTF-8 one ...)

I noticed something similar while trying to get locale.aliases to work (see https://bugzilla.yoctoproject.org/show_bug.cgi?id=11815). I don't know why the .utf8 suffixes to do not appear, but it might be related (perhaps some configuration in glibc is incorrect?). Based on a little bit of testing I did, I think that the utf8 locale might be present as you can do setlocale(LC_ALL, "de_DE.utf8") in C and it should work (you might want to check this yourself). Perhaps the locale program just isn't showing it?

Quoted 5 lines

but its still unset:

$ locale
always outputs "POSIX"

I think you would need to set $LANG to actually change the language, i.e.

$ LANG="de_DE.UTF8" locale
Quoted 13 lines

Also the (usb) keyboard layout does not change.

What do I have to set so the getty has the correct default language?

I also have yocto on a zynq board, where I also can't figure out how to
set the correct locale.

Thank you very much

Florian