• Liyang Hu's avatar
    [PATCH] Bug in NLS UTF-8 code · de6ca58c
    Liyang Hu authored
    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.
    de6ca58c
nls_base.c 14.1 KB