Re: Script to convert utf-8 to html entities?

Amadeus <[email protected]>
Newsgroups gmane.comp.php.internationalization
Message-ID <[email protected]>
> A> I have been having a lot of problems with .po 's in utf-8 on linux 
> A> systems...
> 
> A> A solution to incorrect displays would be to convert the .po content into
> A> html_entities (&#xxxx).
> 
> You can use mb_convert_encoding();
> 
> Tis an example:
> <?php
> $data = file_get_contents('in.po');
> $data = mb_convert_encoding($data, 'HTML-ENTITIES', 'UTF-8');
> $fp = fopen('out.po', 'wb');
> fwrite($fp, $data);
> fclose($fp);
> ?>

Just what I was looking for. I was missing mbstring on this box but it 
works fine now.

Thanks again!

Amadeus

-- 
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org

-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.