Re: utf8 issues in Scintilla(again)

From: Date: Wed, 05 Jul 2006 04:22:44 +0000
Subject: Re: utf8 issues in Scintilla(again)
References: 1 2 3 4 5  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-3196@lists.php.net to get a copy of this message
Yes, unfortunately that's true. Even without Scintilla the user has to make sure that the strings they pass into Gtk+ methods are in one consistent encoding. There is no way around it. -Andrei On Jul 4, 2006, at 9:17 PM, Anant Narayanan wrote:
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


« previous php.gtk.dev (#3196) next »