Re: String encoding in extension API

From: Date: Sun, 26 May 2013 22:30:24 +0000
Subject: Re: String encoding in extension API
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-10687@lists.php.net to get a copy of this message
On Sun, 26 May 2013 22:47:41 +0200, Behnam Esfahbod <behnam@zwnj.org> wrote:
I'm updating pecl/fribidi to use zend_parse_parameters() instead of the ancient zend_get_parameters() and I'm not sure what encoding expect from zpp() when I ask for a string value with non-ascii characters. Is there any conversion done mechanically?
PHP strings have no encoded, they're basically just byte arrays. See the manual: http://php.net/manual/en/language.types.string.php#language.types.string.details
Also, when I call RETURN_STRINGL with some UTF-8 encoded data, I get a double-encoded string in my script. Again, what's the expected encoding for calling RETURN_STRINGL()?
I don't know what the problem is, but in any case RETURN_STRINGL() is not changing the data you're giving it any way. You're probably using the fridibi library incorrectly. -- Gustavo Lopes

« previous php.pecl.dev (#10687) next »