Hi,

If you want to do the full entity translation, use htmlentities() instead 
of htmlspecialchars()

http://www.php.net/htmlspecialchars

Moriyoshi

"Renato De Giovanni" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> We're working on a program that needs to generate an xml document, utf-8 
> encoded, based on information stored with another charset encoding inside a 
> database.
> 
> So basically at some point we have a function that looks like:
> 
> function encodeString($s, $encoding)
> {
>   $s = mb_convert_encoding($s, 'UTF-8', $encoding);
> 
>   $s = htmlspecialchars($s, ENT_COMPAT, 'UTF-8');
> 
>   return $s;
> }
> 
> What happens is that "htmlspecialchars" seems to be always returning a 
> latin1 string, therefore causing problems with the generated document 
> supposedly utf-8 encoded.
> 
> My question is: is this a php bug or am I misunderstanding something related 
> to multi-byte character support?
> 
> PHP version is 4.2.3
> 
> Thank you very much!
> --
> Renato
> CRIA - Centro de Referencia em Informacao Ambiental
> http://www.cria.org.br/
> 
> 
> --
> This message has been scanned for viruses and
> dangerous content and is believed to be clean.
> 
> 
> -- 
> PHP Internationalization Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to