<body>
<textarea cols='80' rows='5' onkeyup='recode(this.value)'>
Скажи-ка дядя, ведь не даром
Белая берёза под моим окном
В тумане моря голубом
Всё ходит по цепи кругом
</textarea>
<p id='Signature'></p>
</body>
JavaScript
var
chars = {
0x2293: "PpПп BbБб",
0x2290: "DdДд TtТт",
0x2294: "VvВв FfФф",
0x228F: "CcСс SsЦцЧчШшЩщ",
0x251C: "AaАа Яя",
0x252C: "UuУу Юю",
0x2534: "OoОо Ёё",
0x2524: "EeЕе Ээ",
0x250C: "GgГг HhХхKkКк",
0x2510: "MmМм NnНн",
0x2518: "JjZzXxЗз Жж",
0x2514: "LlЛл RrРр",
0x2502: "IiИи YyЫыЙйЪъЬь"
};
function recode(text) {
var r = "";
for(var i = 0; i < text.length; ++ i) {
var c = text.charAt(i), d;
for(var j in chars)
if((d = chars[j].indexOf(c)) >= 0 && c != " ")
c = d <= chars[j].indexOf("-- ") ? String.fromCharCode(0xA0, +j, 0x338) : String.fromCharCode(+j);
// c = d > chars[j].indexOf(" ") ? String.fromCharCode(0xA0, +j, 0x338) : String.fromCharCode(0xA0, +j);
r += c;
}
document.getElementById("Signature").innerHTML = r.replace(/\r?\n/g, "<br>");//.replace(/\x20/g, " ");
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.