Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 db
Octocat-spinner-32 tests first commit March 26, 2012
Octocat-spinner-32 ChangeLog first commit March 26, 2012
Octocat-spinner-32 LICENSE first commit March 26, 2012
Octocat-spinner-32 README
Octocat-spinner-32 utf8_to_ascii.php

US-ASCII transliterations of Unicode text

Ported Sean M. Burke's Text::Unidecode Perl module

Use is simple;

require_once '/path/to/utf8_to_ascii/utf8_to_ascii.php';
$utf8 = file_get_contents('/tmp/someutf8.txt');
$ascii = utf8_to_ascii($utf8);

Some notes;

- Make sure you provide is well-formed UTF-8!

- For European languages, it should replace Unicode character
with corresponding ascii characters and produce a readable
result. For other languages, the results will be less
meaningful - it's a "dumb" character for character replacement
True trasliteration is a little more complex than this;

- For any characters for which there's no replacement
character available, a (default) '?' will be inserted. The second
argument can be used to define an alternative replacement char

- Don't panic about all the files in the db subdirectory - they
are not all loaded at once - in fact they are only loaded if they
are needed to convert a given character (i.e. which files get
loaded depends on the input)

For a little more see;
Something went wrong with that request. Please try again.