LKML Archive on
help / color / mirror / Atom feed
From: "Alexander E. Patrakov" <>
To: OGAWA Hirofumi <>
Cc: LKML <>,
	Andrew Morton <>,, Kay Sievers <>
Subject: Re: [PATCH] Sanitize filesystem NLS handling
Date: Mon, 19 Mar 2007 09:38:17 +0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

OGAWA Hirofumi wrote:
> "Alexander E. Patrakov" <> writes:
>>> You allow to set any nls to codepage? If so, it is not good.
>> I did this because it involved less changes. Only FAT treats codepage as a 
>> number. All other filesystems already allow arbitrary NLS as a codepage 
>> mount parameter.
> I'm saying here, it is not good for vfat.

All valid options (i.e. numbers) are still available. Prohibiting 
non-numbers is a lot of work (changing module_param_string to 
module_param_call and validating the passed string, and also changing the 
code for all filesystems so that they also validate manually-passed codepage 

>>> No, utf-8 makes completely wrong entry. It's more wrong than other nls.
>> For any non-UTF-8 based locales, the other NLS is correct and utf8 indeed 
>> would produce completely wrong characters. But for UTF-8 based locales, utf8 
>> is the only correct iocharset.
> No, iocharset=utf8 is wrong always.

Here we just disagree, but I think I can change your opinion by giving you a 
correctly configured UTF-8 Japanese system in the form of a LiveCD (note: 
the kernel doesn't have this patch there). If you can afford ~500 MB of 
downloads, please do this:

1) download 
and burn it
2) write (from Windows, because it cannot be misconfigured) some files with 
Japanese filenames to your flash drive
3) boot the CD, type the following at the boot prompt: linux 
LANG=ja_JP.UTF-8 TZ=Asia/Tokyo
4) edit /etc/X11/xorg.conf (should be probably unneeded, but I ask just in 
case. If you have to edit xorg.conf, report a bug to me privately)
5) startx (to get a Japanese environment)
6) open the terminal
7) yes --help (are the proper Japanese characters displayed? If not, change 
the font in the menu to some Kochi family and report this to me as a bug - 
yes I know about the Japanese opposition to Unicode because of Han Unification)
8) mount -o iocharset=utf8,codepage=932 /dev/sda1 /mnt (here I assume that 
your flash drive appears as sda1, adjust as needed)
9) ls -l /mnt (do Japanese filenames appear correctly?)
10) umount /mnt

If you want to experiment with the more traditional ja_JP.eucjp locale, you 
are also welcome to do so (but then iocharset=euc-jp will be needed to show 
filenames correctly).

> Why I can't use utf8 for jfs or something, and use other nls for vfat?

Because you'll get a mismatch between the userspace locale and the iocharset 
used by the kernel in at least one of these two cases. The mismatch will 
result in the following:

1) Your system (e.g., the "ls" command) will not correctly interpret 
filenames written by known-good setups.
2) Known-good setups will not correctly interpret filenames written by your 

What probably happened in your case is that you have no known-good jfs-based 
setup and are the only user of your jfs disk, and thus can't see (2). It 
looks like you don't use UTF-8 userspace locale. Then, the on-disk filenames 
on your jfs filesystem are wrong, but your system misinterprets them, and 
two errors seem to cancel each other (but this still doesn't make it a 
correct setup).

Alexander E. Patrakov

  reply	other threads:[~2007-03-19  4:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-18 16:55 Alexander E. Patrakov
2007-03-18 22:01 ` OGAWA Hirofumi
2007-03-19  2:58   ` Alexander E. Patrakov
2007-03-19  3:46     ` OGAWA Hirofumi
2007-03-19  4:38       ` Alexander E. Patrakov [this message]
2007-03-19  5:38         ` OGAWA Hirofumi
2007-03-19  5:49           ` Alexander E. Patrakov
2007-03-19 14:25             ` OGAWA Hirofumi
2007-03-19 15:04               ` Alexander E. Patrakov
2007-03-19 17:26                 ` OGAWA Hirofumi
2007-03-20  6:25                   ` Alexander E. Patrakov
2007-03-21 16:50                     ` OGAWA Hirofumi
2007-03-19 15:10               ` Alexander E. Patrakov
2007-03-19 17:36                 ` OGAWA Hirofumi
2007-03-19  6:38     ` yes --help (was: [PATCH] Sanitize filesystem NLS handling) Bernd Eckenfels
2007-03-19  8:14       ` Alexander E. Patrakov
2007-03-22 12:59 ` [PATCH] Sanitize filesystem NLS handling Roman Zippel
2007-03-22 13:22   ` Alexander E. Patrakov
2007-03-22 13:49     ` Roman Zippel
2007-03-22 13:59       ` Alexander E. Patrakov
2007-03-22 15:45         ` Roman Zippel
2007-03-22 14:58       ` Alexander E. Patrakov
2007-03-22 16:07 ` Alexander E. Patrakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] Sanitize filesystem NLS handling' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).