From de6ca58cca1a0b2452321cdbdec0dead70dbf5b5 Mon Sep 17 00:00:00 2001 From: Liyang Hu Date: Sun, 14 Apr 2002 23:28:40 -0700 Subject: [PATCH] Bug in NLS UTF-8 code I've recently (actually, last month, but I had been a bit too busy since then) come across a wee problem, in what I originally thought was the VFAT code -- having `utf8' as one of the options, creating UTF-8 file names on a VFAT partition mysteriously gains a couple of (random) characters just after the UTF-8 escaped character: eg. touch "fooCbar" where C is an UTF-8 escape sequence ends up creating a file named "fooCRbar". (R being some random character.) I eventually tracked it down to one line in fs/nls/nls_base.c -- the UCS-2 (wchar_t) string pointer was being incremented too fast. After consulting Ogawa Hirofumi-san on the subject, he mentioned that include/linux/nls.h also needs to be changed for proper UTF-8 support in the NLS code. --- include/linux/nls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/nls.h b/include/linux/nls.h index f47902bcfdb0..2ab6466f8043 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h @@ -18,7 +18,7 @@ struct nls_table { }; /* this value hold the maximum octet of charset */ -#define NLS_MAX_CHARSET_SIZE 3 +#define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ /* nls.c */ extern int register_nls(struct nls_table *); -- cgit v1.2.3