Re: UTF-8 files and include
| From: | Ivan Enderlin @ Hoa | Date: | Wed, 22 Aug 2012 08:52:13 +0000 |
| Subject: | Re: UTF-8 files and include | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62400@lists.php.net to get a copy of this message | ||
On 22/08/12 10:16, Pierre Joye wrote:
On Wed, Aug 22, 2012 at 9:04 AM, Ivan Enderlin @ Hoa <ivan.enderlin@hoa-project.net> wrote:It is not possible yet to automatically detect the codepage on Windows. Also it may be changed during the request time (unlikely but possible). But if you know it, say using an configuration parameter, then convert from/to UTF-8 to/from this codepage using mbstring and pass the result to the file functions, require&co. But that's really tricky and buggy.As it may (very often) works smoothly on most unices, it won't work ever using current releases or master on Windows. One has to set the correct codepage and do the conversion from/to UTF-8.Exactly. I can detect if PHP is running on Windows and making the conversion on-the-fly but what kind of conversion? I have tried with utf8_decode() but it seems to also fail.Any other idea?Yes, don't use UTF-8 in your filenames, that's not portable and bring all kind of issues (not necessary only on windows). I had tried :-).
I told you that already back then on twitter too when you asked me about this issue. On Twitter? Donnot remember.Thanks! -- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/