locales, nls - supportable or not?

Alberto Hernando pajaro.go at gmail.com
Tue Nov 14 23:53:30 PST 2006


> there was a thread on blfs-support that really made me think that all my
> efforts of adding locale support to the book were in vain. 

I'm the one who started this. First of all, thanks for your efforts and your 
care, and second, sorry for not replying to the dev lists, as I'm not 
subscribed to them. I'll do in other to help with this issue.

> Now, the correct answer to the thread mentioned above.
> > nls_utf8 doesn't seem to be used, but I don't know it this right
> This isn't right. The problem is that the iocharset absolutely needs to
> match the locale. You have to use iocharset=utf8. This is documented in
> the book, on the fstab page: "Filesystems with MS-DOS or Windows origin
> (i.e.: vfat, ntfs, smbfs, cifs, iso9660, udf) need the iocharset mount
> option in order for non-ASCII characters in file names to be interpreted
> properly. The value of this option should be the same as the character
> set of your locale, adjusted in such a way that the kernel understands it."

But, according to man mount, vfat doesn't support to be mounted with 
iocharset=utf8. And I think that this is the bassic problem.

> > And last thing: the characters used to make squares in ncurses.
> > Configuring the kernel, for example. make menuconfig gives garbage in
> > the console, but looks nice under X, with an ext3 filesystem.
> Incorrect contents of /etc/sysconfig/console. Please use:
> KEYMAP="es euro2"
> FONT="LatArCyrHeb-16"   # or "lat0-16"
> LEGACY_CHARSET="iso-8859-15"

Ok, I'll try this.

> This will (contrary to what Dan Nicholson states) give you the correct
> input and display of all characters used in Spanish both in the console
> and in xterm. 

The if $TERM solution gave some results, such as typing accented vowels both 
in console and X. But if this is the proper way, I'll change it.

> You can also download LFS LiveCD and see the result 
> yourself by default (but, of course, you have to mount vfat with
> iocharset=utf8 yourself, the CD can't automagically add this option).

I have the LiveCD (6.2), which I used to build the LFS. But again, I think 
that mounting vfat with iocharset=utf8 doesn't work.

> And Japanese on the console is not possible without software like iterm
> (but even then, only output, not input, is possible). For Japanese in X,
> read http://wiki.linuxfromscratch.org/blfs/wiki/InputMethods

No problem with this. I don't need it in console, and works nice with X.

> > Only one question: how do you set utf-8 for X and, say, iso-8859-15
> > for console?
> You don't - this is an inherently broken setup. If you do this, in the
> console you won't be able able to read documents that were created in X,
> and the other way round. You want es_ES.UTF-8 in both places. And the
> latest kernel even doesn't need patches for this to work (but that's
> only because your keymap doesn't produce characters outside of Latin-1
> using dead keys).

By "latest kernel" you mean 2.6.18 or 2.6.19-rcX? 2.6.19 is nearly out. I can 
try everything again when it is releases.

Now, last thing. The situation now is that I see well the names of archives 
with accents (in vfat, of course) and in X, with an X editor (kate, kile...) 
I don't see the accents inside the file but I see where they should go. "áe" 
becomes "square", for example. Notice "áe", not "á". With other settings, I 
simply didn't see "á" or have more garbage.

This issue is very important for me, as it is preventing me from migrating to 
LFS as my usual system. I'll do any test you think can help, even rebuilding 
all the system if needed (perhaps I need newer glibc,...). I have a partition 
for it.

Thanks for all.

PS: I've sent the mail using... utf-8, as I had to write some accented vowels. 
I hope it is visible.

More information about the lfs-dev mailing list