Home
Benjamin C. Wiley Sittler [entries|archive|friends|userinfo]
Benjamin C. Wiley Sittler

[ website | bsittler ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

unidecode_php-0.3.tar.gz [Dec. 18th, 2008|11:39 pm]
[Tags|, , ]

I recently wrote a conversion script and PHP wrapper so that the data from the Perl "last-chance transliterator" Text::Unidecode by Sean M. Burke can be used from PHP: unidecode_php-0.3.tar.gz. To use this you'll need to install the Perl Text::Unidecode module and then run the udec2bin.pl script inside the unidecode_php package.

Example PHP usage:

<?php
require("unidecode.php");
print htmlspecialchars(unidecode("中文", "utf-8"));
?>
produces
Zhong Wen

This allows very basic conversion of lots of Unicode to plain ASCII. It works pretty well for some scripts and languages, is somewhat usable for several more, and fails utterly in some. Here are some examples excerpted from the Emacs-MULE HELLO file, along with their ASCII transliterations: (long) )

update: version 0.2 adds a couple examples.

update: version 0.3 is better at finding the datafiles when included from another directory.

linkpost comment

ǝsnqɐ ǝpoɔıun [Jan. 25th, 2008|11:51 am]
[Tags|, , , ]

(ɥo‾uı‾uosılɐ ɯoɹɟ) ɐɔɐɔqıl ʎq pǝsn sʇɔǝɟɟǝ ǝɥʇ ɟo ǝɯos ɟo ǝɯ spuıɯǝɹ lɯʇɥ˙dılɟ/ɯoɔ˙pɐɟʌǝɹ˙ʍʍʍ//:dʇʇɥ

link15 comments|post comment

navigation
[ viewing | most recent entries ]

Advertisement