Amadeus wrote:

A> Hello,

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).

A> I don't know a lot about this, but can anyone post a script snippet to do
A> this?

A> Ie. read a .po file and output the same with html entities?

A> I have tried sending gettext output to html_entities() through php, but
A> gettext doesn't even return the utf-8 content correctly in the first place.

A> I have seen a lot of javascript scripts which work fine, but am looking for
A> a command line script (perl/php etc.)

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);
?>

-- 
Best regards,
 Hayk
 mailto:[EMAIL PROTECTED]

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

Reply via email to