Re: utf-8 filenames in phar files.

From: Date: Tue, 22 Apr 2014 18:36:31 +0000
Subject: Re: utf-8 filenames in phar files.
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-73766@lists.php.net to get a copy of this message
On Tue, Apr 22, 2014 at 12:06 AM, Stas Malyshev <smalyshev@sugarcrm.com>wrote: > Hi! > > > I have created a quick PR: > > https://github.com/php/php-src/pull/649 that > > is fixing the ill-formed UTF-8 paths. > > Thanks for the patch. One thing I'd like to understand is what is the > added value of being so strict in checking UTF-8. I.e. what would happen > if we allow some path with weird chars in? > > I think that validation is important to prevent user errors. The problem is that the currently accepted implementation (MB2, MB3, MB4) just pretending that validates UTF-8. However the validation is incorrect. It doesn't allow to use weird characters (there is already check for UTF-8 sequences) but it allows surrogate pair code points which is wrong IMHO. The PR fixes that. It just correctly checks for ill-formed charcters. In regards to normalization I think that Yasuo is right that there will be unhappy users. On the other side, I think that there are more users that would like to use UTF-8 paths at all. Normalization is a bit tricky and the only solution that comes to my mind ATM is dependency on ICU which wouldn't be right IMHO. Jakub

« previous php.internals (#73766) next »