Recommend this page to a friend! |
Download .zip |
Info | View files (12) | Download .zip | Reputation | Support forum (4) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2005-10-26 (11 years ago) | 59% | Total: 1,962 This week: 1 | All time: 1,940 This week: 1,047 |
Version | License | Categories | ||||
cyrlat 1.0 | Freeware | Localization, Text processing, Conver... |
Description | Author | |||||||||||||
This is a simple class can convert text between representations using cyrillic and latin character sets. |
|
INTRO This class *Cyrillic to Latin (translit)* provides methods for converting (translitering) symbols. License: FREEWARE (please, leave my copyright!). What you need to work with this class: No additional extensions/pears/pecls needed. functions: string cyr2lat(input string) - cyrillic to latin convert string lat2cyr(input string) - latin to cyrillic convert variables: array $cyr - cyrillic symbols array $lat - latin replacement for cyrillic symbols array $lat_additional - additional latin symbols set (for non-usuall replacements) array $cyr_additional - additional cyrillic symbols (to replace non-usuall latin symbol replacements) BUGS Known bugs and _undocumented features_: + Work only with Windows-1251 codepage. If you want use it with koi8-r or other, use php-standard function convert_cyr_string(...) on your input, like <code> #... $input=convert_cyr_string($input, "k", "w"); //convert from KOI8-R to Windows-1251 #... </code> + Some symbolsets have wrong translitering (by their dual nature). For example: "Shoroh" is "Шорох" and "Shvatka" is "Шватка" (not "Схватка"). Bugfix: manual editing of outputed string :) # Слижком уж он велик и могуч, этот Русский язык. Всё алгоритмом не опишешь. + Class represent my own vision of translit rules. If you want "Jopa" instead of "Zhopa" - edit $cyr and $lat (!notice) symbols order matters in arrays $cyr, $lat, $cyr_additional, $lat_additional! USAGE The usage is rather simple: <code> #------->8------test.php------------ <?php require_once("cyrlat.class.php");// include main class $text=new CyrLat; // initialize $text as $input="Привет, Мир!"; echo $text->cyr2lat($input); echo "<hr>\n"; $input="Privet, Mir!"; echo $text->lat2cyr($input); ?> #-------8<--------------------------- </code> See /examples/ for more examples. You can simply integrate it to forums, forms, sms-senders etc. Da pribudet s vami Sila! |
Files |
File | Role | Description | ||
---|---|---|---|---|
examples (3 files, 1 directory) | ||||
cyrlat.class.php | Class | main class | ||
readme.txt | Doc. | English readme text | ||
test.php | Example | main classsymple example |
Files | / | examples |
File | Role | Description | ||
---|---|---|---|---|
AjaxTest (3 files, 1 directory) | ||||
cyr2lat_test.php | Example | cyrillic to latin symbols test | ||
forms_test.php | Example | usage example with forms | ||
lat2cyr_test.php | Example | latin to cyrillic symbols test |
Files | / | examples | / | AjaxTest |
File | Role | Description | ||
---|---|---|---|---|
lib (3 files) | ||||
testAjax.php | Example | Ajax test script | ||
lat2cyr.php | Appl. | loader | ||
readme.txt | Doc. | Ajax test script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | User Comments (2) | |||||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Pages that reference this package |
Cyrillic to Latin This class converts cyrillic characters into the latin and vice-versa. |