ReCoder in JavaScript
Written by Alexey Roytman, 2002.
Modified on January 24, 2004
This small utility recodes Cyrillic text from one encoding to another.
For instructions and description see below the input areas.
It can either recode the text from the text area you printed it in
(thus replacing the original text), or in a newly opened window
(thus leaving the original text without changes).
When you convert from and to Transliteration back and forth (for example, when fixing
typographical mistakes), it's recommended to convert into new window, because
such conversions are typically irreversible (because of escaping and separating rules).
When converting from Transliteration to Cyrillic,
the "separators" make characters to be separate
(when otherwise they will be joined by some rules). The "escapers" are pairs of symbols
that symbolic sequence between them is not converted.
There may be multiple "separators".
There may be multiple "escapers" (each pair may escape another pair), and the
opening/closing symbols may be either different or same.
Useful "separators" string: #~
Useful "escapers" string (pairs): {}<>[]||
Example for user defined rules: tv=ÔÅÌÅ×ÉÚÏÒ,mgr=manager,j=Ö,yu=À
Test example:
Trap (*ne* anglijskoe [<]trap[>], <`>lovushka<'>)
est' ljogkie korabel'nye s#hodni (ot slova <`>sxodit'<'>).
Vz`elsya - ot slova |`|est'|'| s pristavkoj |`|vz|'|,
oznachajushchej neozhidannost', vnezapnost' (sr. [`]vzvilsq[']).
Vypolnqjutsq sledujushchie usloviq (dlq veshchestvennogo |z|):
[#]1. [|z|] [>] 1 =|>| [z*z] |>| <|>[z]<|>
|#|2. (|z|) -- veshchestvenno
<#>3. -1 [<=] [sin]() |<=| +1
[#4]. |z| |>| 1 |=>| [z*z] [>] [|z|]
<#5>. [>] 0 [=>] <[>|z]| |<=|
I \eto ochevidno.
Slavnyj gorod N'ju-JJork v shtate N'ju-J#ork.