From: "Pali Rohár" <pali@kernel.org>
To: "Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp"
<Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp>
Cc: "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"'linux-fsdevel@vger.kernel.org'" <linux-fsdevel@vger.kernel.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
"'namjae.jeon@samsung.com'" <namjae.jeon@samsung.com>,
"'sj1557.seo@samsung.com'" <sj1557.seo@samsung.com>
Subject: Re: [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF
Date: Mon, 13 Apr 2020 12:10:07 +0200 [thread overview]
Message-ID: <20200413101007.lbey6q5u6jz3ulmr@pali> (raw)
In-Reply-To: <TY1PR01MB15784063EED4CEC93A2B501390DD0@TY1PR01MB1578.jpnprd01.prod.outlook.com>
On Monday 13 April 2020 08:13:45 Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp wrote:
> > On Wednesday 08 April 2020 03:59:06 Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp wrote:
> > > > So partial_name_hash() like I used it in this patch series is enough?
> > >
> > > I think partial_name_hash() is enough for 8/16/21bit characters.
> >
> > Great!
> >
> > Al, could you please take this patch series?
>
> I think it's good.
>
>
> > > Another point about the discrimination of 21bit characters:
> > > I think that checking in exfat_toupper () can be more simplified.
> > >
> > > ex: return a < PLANE_SIZE && sbi->vol_utbl[a] ? sbi->vol_utbl[a] : a;
> >
> > I was thinking about it, but it needs more refactoring. Currently
> > exfat_toupper() is used on other places for UTF-16 (u16 array) and therefore it cannot be extended to take more then 16
> > bit value.
>
> I’m also a little worried that exfat_toupper() is designed for only utf16.
> Currently, it is converting from utf8 to utf32 in some places, and from utf8 to utf16 in others.
> Another way would be to unify to utf16.
>
> > But I agree that this is another step which can be improved.
>
> Yes.
There are two problems with it:
We do not know how code points above U+FFFF could be converted to upper
case. Basically from exfat specification can be deduced it only for
U+0000 .. U+FFFF code points. We asked if we can get answer from MS, but
I have not received any response yet.
Second problem is that all MS filesystems (vfat, ntfs and exfat) do not
use UCS-2 nor UTF-16, but rather some mix between it. Basically any
sequence of 16bit values (except those :/<>... vfat chars) is valid,
even unpaired surrogate half. So surrogate pair (two 16bit values)
represents one unicode code point (as in UTF-16), but one unpaired
surrogate half is also valid and represent (invalid) unicode code point
of its value. In unicode are not defined code points for values of
single / half surrogate.
Therefore if we talk about encoding UTF-16 vs UTF-32 we first need to
fix a way how to handle those non-representative values in VFS encoding
(iocharset=) as UTF-8 is not able to represent it too. One option is to
extend UTF-8 to WTF-8 encoding [1] (yes, this is a real and make sense!)
and then ideally change exfat_toupper() to UTF-32 without restriction
for surrogate pairs values.
Btw, same problem with UTF-16 also in vfat, ntfs and also in iso/joliet
kernel drivers.
[1] - https://simonsapin.github.io/wtf-8/
next prev parent reply other threads:[~2020-04-13 10:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 2:18 [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Kohada.Tetsuhiro
2020-04-03 20:40 ` Pali Rohár
2020-04-06 9:37 ` Kohada.Tetsuhiro
2020-04-07 10:06 ` Pali Rohár
2020-04-08 3:59 ` Kohada.Tetsuhiro
2020-04-08 9:04 ` Pali Rohár
2020-04-13 8:13 ` Kohada.Tetsuhiro
2020-04-13 10:10 ` Pali Rohár [this message]
2020-04-14 9:29 ` Kohada.Tetsuhiro
2020-04-14 9:47 ` Pali Rohár
2020-04-15 7:46 ` Kohada.Tetsuhiro
-- strict thread matches above, loose matches on Subject: below --
2020-03-17 22:25 [PATCH 0/4] Fixes for exfat driver Pali Rohár
2020-03-17 22:25 ` [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Pali Rohár
2020-03-18 0:09 ` Al Viro
2020-03-18 9:32 ` Pali Rohár
2020-03-28 23:40 ` Pali Rohár
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200413101007.lbey6q5u6jz3ulmr@pali \
--to=pali@kernel.org \
--cc=Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
--cc=sj1557.seo@samsung.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).