Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hello there everyone!

 

In chapter 14, i found the collation easy and simple to accomplish using the Collator object in PHP 5, but i haven't yet been able to accomplish transliterstion into different languages and character sets( Script 14.4 Trans.php ). I've tried to use iconv to get script 14.4 to work, but so far, it has failed me. And looking at the manual, the Transliterator object should be able to help me do this, but the documentation is vague and unsatisfactory at best. Has anyone else tackled transliteration in script 14.4 using PHP 5?

Link to comment
Share on other sites

  • 1 month later...

Terribly, terribly sorry for the delay on this. I've been wrapping up a book (way behind schedule) that I just finished two days ago. Then I had to install a custom version of PHP. The good news is that I was able to fix this, and the fix is easy. The bad news is that it requires PHP 5.4. Once you have PHP5.4, you only need to change the function call in trans.php:

 

echo "<p>$me is " . transliterator_transliterate ("Latin-$script", $me) . " in $script.</p>\n";

Originally the function call was:

 

echo "<p>$me is " . str_transliterate($me, 'Latin', $script) . " in $script.</p>\n";

I just tested it myself and it works fine. Let me know if you have any questions or problems. Apologies again for the delay!

Link to comment
Share on other sites

 Share

×
×
  • Create New...