This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//safeTransliterate v3, copyright (cc-by 3.0) Kroc Camen <camendesign.com> | |
//generate a safe (a-z0-9_) string, for use as filenames or URLs, from an arbitrary string | |
function safeTransliterate ($text) { | |
//if available, this function uses PHP5.4's transliterate, which is capable of converting arabic, hebrew, greek, | |
//chinese, japanese and more into ASCII! however, we use our manual (and crude) fallback *first* instead because | |
//we will take the liberty of transliterating some things into more readable ASCII-friendly forms, | |
//e.g. "100℃" > "100degc" instead of "100oc" | |
/* manual transliteration list: | |
-------------------------------------------------------------------------------------------------------------- */ |