[TxMt] [PHP] Run command and encoding… (ord() function)

guerom00 romain.guerout at stud.unibas.ch
Mon Nov 6 11:40:14 UTC 2006


Hi there,

I have this very simple PHP code as a test : 
<?php
        $chaine = "é";
        echo ord($chaine[0])." ".ord($chaine[1]);
?>
The $chaine variable is initialized with «é» (e with acute accent) 
just in case…

If I save this file in UTF-8 as usual and use the “Run” command,
it returns “195 169”, as it should : it's the UTF-8 representation
of the letter é.
But if I save this same file in ISO-8859-1 and use the “Run”
command once again, I still have “195 169” whereas I should
have “233” (representation of é in ISO-8859-1).

Note that I don't have any problem if I host the files 
on a server somewhere. Therefore, it seems to be a small
bug with the PHP “Run” command which returns the UTF-8
representation no matter what…

Thanks in advance :-)




More information about the textmate mailing list