GreyWyvern.com

PHP Scripts and Tools

Encoding Conversion Functions

These days, I use separate encoded text files for languages; one using UTF-8 and one using the traditional character encoding of the text. In the past, I translated the traditionally encoded text to UTF-8 on the fly, which only required one language file, but turned out to be too much of a hassle to keep up. Nevertheless, the recoding functions I translated into PHP from the original Perl module NexTrieve::UTF8, turned out to be useful in their own right.

There do exist PHP functions which convert any character encoding to any other with ease. However, because they're new, and/or require special compiled modules to use, they aren't always available to everyone. The functions below rely on basic low-level byte-by-byte conversion.

Valid XHTML 1.0! Copyright © 2009 Brian Huisman AKA GreyWyvern
ContactSite mapSearch