Re: utf8 issues in Scintilla(again)
| From: | Anant Narayanan | Date: | Wed, 05 Jul 2006 04:17:50 +0000 |
| Subject: | Re: utf8 issues in Scintilla(again) | ||
| References: | 1 2 3 4 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-3194@lists.php.net to get a copy of this message | ||
Hi Andrei,
> Does Scintilla operate in UTF-8 internally or not? If yes, then we do
> need to convert the text to UTF-8 form (which is done incorrectly here
> with "s" specifier). If no, then we should just pass the string straight
The problem here is that text specified in the script and text taken
from a file are treated differently by PHP:
$x = "ééé Sequência inválida na entrada de conversão";
var_dump($x);
gives me:
string(58) "ééé Sequência inválida na entrada de conversão"
while;
$x = file_get_contents("text.txt");
var_dump($x);
gives:
string(50) "ééé Sequência inválida na entrada de conversão"
where the file "text.txt" contains the same string as $x in the first
example. Example 2 works as expected, but Example 1's behaviour is quite
puzzling to me. Ideally, the user should be able to pass either kind of
variable to set_text() and expect it to give consistent results.
If that's not possible, then the burden of ensuring that all the text
passed to set_text() should be UTF8 encoded, will be on the user.
- Anant