[...]
$entities[chr(248)] = 'ø';
$entities[chr(249)] = 'ù';
$entities[chr(250)] = 'ú';
$entities[chr(251)] = 'û';
$entities[chr(252)] = 'ü';
$entities[chr(253)] = 'ý';
$entities[chr(254)] = 'þ';
$entities[chr(255)] = 'ÿ';
$entities[chr(338)] = 'Œ';
$entities[chr(339)] = 'œ';
[...]
$str = strtr($str, $entities);
Now, I admit I don't know much about character encodings. My site is in standard ISO as are my scripts. I know there are only 255 characters in the basic ISO set but there are additional sets containing characters XHTML needs to be represented by entities. When testing my function it produced utter garbage, replacing some characters, whether they be special or normal letters, with various characters from the array. I eventually found that by removing all characters in the array above 255 the function works fine. I then assume that the chr() function is limited to the basic 255 characters. When I started writing this though I ponder if perhaps the limitation is in strtr(). If the limitation is strtr(), which I think less likely, I could easily make due with str_replace(). However, if the limitation is in chr() as I suspect, are there any possible workarounds or other functions I might look into?
Thanks in advanced. Sorry for the long-winded message.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php