Re: [PHP] Convert fake Unicode to real UTF-8

2005-11-04 Thread Andreas Jakl
Thanks for the tip! htmlentities() didn't work, as it just converted the
 in the string to amp;. However, following the trail I did get it
working the other way round, using:

html_entity_decode($row['text'], ENT_NOQUOTES, UTF-8)

After this call, I had a real unicode text in my output file.

About the question where I saw it - both in phpMyAdmin and in my own PHP
script. It seems to be really stored as an ASCII text in the DB, as a
substr($row['text'], 0, 1) also simply outputs .

Thanks for your help,
Andreas

Minuk Choi schrieb:
 Have you tried feeding that through htmlentities()?
 
 e.g. echo htmlentities(#1043;#1072;);
 
 see if that outputs what you want on the page.
 
 -Mk
 
 
 Andreas Jakl wrote:
 
 I've been searching for quite some time now and tried several functions,
 but didn't find a solution. I hope somebody can point me in the right
 direction.

 The problem:

 Russian text is entered through a web form. It's a rather badly
 administrated external webserver with old versions of everything, so I
 can not set the table to UTF-8. In the MySQL-Table the text gets
 converted to something like #1043;#1072; as an ASCII text.

 Using PHP I need to get the text out into a plain text file, as a real
 UTF-8 string.

 How can I convert this? All the conversion methods from PHP that I tried
 failed, as the text seems to really consist of the individual ASCII
 chars like , #. Therefore, a normal to-unicode-conversion doesn't
 change anything.

 Thanks in advance,
 Andreas Jakl

  


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



[PHP] Convert fake Unicode to real UTF-8

2005-11-03 Thread Andreas Jakl
I've been searching for quite some time now and tried several functions,
but didn't find a solution. I hope somebody can point me in the right
direction.

The problem:

Russian text is entered through a web form. It's a rather badly
administrated external webserver with old versions of everything, so I
can not set the table to UTF-8. In the MySQL-Table the text gets
converted to something like #1043;#1072; as an ASCII text.

Using PHP I need to get the text out into a plain text file, as a real
UTF-8 string.

How can I convert this? All the conversion methods from PHP that I tried
failed, as the text seems to really consist of the individual ASCII
chars like , #. Therefore, a normal to-unicode-conversion doesn't
change anything.

Thanks in advance,
Andreas Jakl

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