| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Paḷi Code Transfer</title>
- <link type="text/css" rel="stylesheet" href="../pcdl/css/font.css">
- <script language="javascript" src="js/vn.js"></script>
- <script language="javascript" src="js/xml.js"></script>
- <script language="javascript" src="js/filenew.js"></script>
- <script language="javascript" src="js/editor.js"></script>
- <script language="javascript" src="../public/charcode/sinhala.js"></script>
- <script language="javascript" src="../public/charcode/unicode.js"></script>
- <script language="javascript" src="../public/charcode/myanmar.js"></script>
- <script language="javascript" src="../public/charcode/tai_tham.js"></script>
- <script language="javascript" src="../public/charcode/thai.js"></script>
- <script language="javascript">
- function sangayana2unicode(inStr, inM, inM2) {
- var output = inStr;
- output = output.replace(/ïk/g, inM + "k");
- output = output.replace(/ïg/g, inM + "g");
- output = output.replace(/ü/g, inM);
- output = output.replace(/§/g, inM);
- output = output.replace(/ṃ/g, inM);
- output = output.replace(/ðK/g, inM2 + "K");
- output = output.replace(/ðG/g, inM2 + "G");
- output = output.replace(/ý/g, inM2);
- for (unicode_i in char_sanga_to_unicode) {
- eval("output=output.replace(/" + char_sanga_to_unicode[unicode_i].id + "/g,char_sanga_to_unicode[unicode_i].value);");
- }
- return (output);
- }
- function s2u() {
- mstr = document.getElementById("m_str").value;
- mlower = mstr.split(",")[0];
- mupper = mstr.split(",")[1];
- txt = document.getElementById("txtInput").value;
- document.getElementById("txtOutput").value = sangayana2unicode(txt, mlower, mupper);
- }
- function unicode2sangayana(inStr, inM, inM2) {
- var output = inStr;
- for (unicode_i in char_unicode_to_sanga) {
- eval("output=output.replace(/" + char_unicode_to_sanga[unicode_i].id + "/g,char_unicode_to_sanga[unicode_i].value);");
- }
- return (output);
- }
- function u2s() {
- mstr = document.getElementById("m_str").value;
- mlower = mstr.split(",")[0];
- mupper = mstr.split(",")[1];
- txt = " " + document.getElementById("txtInput").value;
- document.getElementById("txtOutput").value = unicode2sangayana(txt, mlower, mupper);
- }
- function sinhala2pali() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_si_to_unicode) {
- eval("txt=txt.replace(/" + char_si_to_unicode[u2s_i].id + "/g,char_si_to_unicode[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function u2sinhala1() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_unicode_to_si_c) {
- eval("txt=txt.replace(/" + char_unicode_to_si_c[u2s_i].id + "/g,char_unicode_to_si_c[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = txt;
- }
- function u2sinhala2() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_unicode_to_si_n) {
- eval("txt=txt.replace(/" + char_unicode_to_si_n[u2s_i].id + "/g,char_unicode_to_si_n[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = txt;
- }
- function unicode2unicode(inStr, inM, inM2) {
- var output = inStr;
- output = output.replace(/ṅk/g, inM + "k");
- output = output.replace(/ṅg/g, inM + "g");
- output = output.replace(/ŋk/g, inM + "k");
- output = output.replace(/ŋg/g, inM + "g");
- output = output.replace(/ŋ/g, inM);
- output = output.replace(/ṁ/g, inM);
- output = output.replace(/ṃ/g, inM);
- output = output.replace(/ṃk/g, "ṅk");
- output = output.replace(/ṁk/g, "ṅk");
- output = output.replace(/ṃg/g, "ṅg");
- output = output.replace(/ṁg/g, "ṅg");
- output = output.replace(/ṄK/g, inM2 + "K");
- output = output.replace(/ṄG/g, inM2 + "G");
- output = output.replace(/ŊK/g, inM2 + "K");
- output = output.replace(/ŊG/g, inM2 + "G");
- output = output.replace(/Ŋ/g, inM2);
- output = output.replace(/Ṁ/g, inM2);
- output = output.replace(/Ṃ/g, inM2);
- output = output.replace(/ṂK/g, "ṄG");
- output = output.replace(/ṀK/g, "ṄG");
- output = output.replace(/ṂG/g, "ṄG");
- output = output.replace(/ṀG/g, "ṄG");
- return (output);
- }
- function u2u() {
- mstr = document.getElementById("m_str").value;
- mlower = mstr.split(",")[0];
- mupper = mstr.split(",")[1];
- txt = document.getElementById("txtInput").value;
- document.getElementById("txtOutput").value = unicode2unicode(txt, mlower, mupper);
- }
- function b2s() {
- mstr = document.getElementById("m_str").value;
- mlower = mstr.split(",")[0];
- mupper = mstr.split(",")[1];
- txt = document.getElementById("txtInput").value;
- document.getElementById("txtOutput").value = txt.toLowerCase();
- }
- function u2lkcd() {//兰卡详尽版
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_chinese_pronounce_1) {
- eval("txt=txt.replace(/" + char_chinese_pronounce_1[u2s_i].id + "/g,char_chinese_pronounce_1[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function myanmar_to_roman_1() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (m_to_r_i in char_myn_to_roman_1) {
- eval("txt=txt.replace(/" + char_myn_to_roman_1[m_to_r_i].id + "/g,char_myn_to_roman_1[m_to_r_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function myanmar_to_roman_2() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (m_to_r_i in char_myn_to_roman_2) {
- eval("txt=txt.replace(/" + char_myn_to_roman_2[m_to_r_i].id + "/g,char_myn_to_roman_2[m_to_r_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function tai_tham_to_roman() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (tai_to_r_i in char_tai_to_roman) {
- eval("txt=txt.replace(/" + char_tai_to_roman[tai_to_r_i].id + "/g,char_tai_to_roman[tai_to_r_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function tai_old_to_roman() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (tai_o_to_r_i in char_tai_old_to_r) {
- eval("txt=txt.replace(/" + char_tai_old_to_r[tai_o_to_r_i].id + "/g,char_tai_old_to_r[tai_o_to_r_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function thai_to_roman() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (thai_to_r_i in char_thai_to_roman) {
- eval("txt=txt.replace(/" + char_thai_to_roman[thai_to_r_i].id + "/g,char_thai_to_roman[thai_to_r_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function roman_to_myanmar() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (r_to_m_i in char_roman_to_myn) {
- eval("txt=txt.replace(/" + char_roman_to_myn[r_to_m_i].id + "/g,char_roman_to_myn[r_to_m_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function roman_to_tai_tham() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (r_to_m_i in char_roman_to_tai) {
- eval("txt=txt.replace(/" + char_roman_to_tai[r_to_m_i].id + "/g,char_roman_to_tai[r_to_m_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function roman_to_thai() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (r_to_m_i in char_roman_to_thai) {
- eval("txt=txt.replace(/" + char_roman_to_thai[r_to_m_i].id + "/g,char_roman_to_thai[r_to_m_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
-
- function u2lkcs() {//兰卡简易版
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_chinese_pronounce_2) {
- eval("txt=txt.replace(/" + char_chinese_pronounce_2[u2s_i].id + "/g,char_chinese_pronounce_2[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function u2cnnandiya() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_chinese_pronounce_CN_Nadiya) {
- eval("txt=txt.replace(/" + char_chinese_pronounce_CN_Nadiya[u2s_i].id + "/g,char_chinese_pronounce_CN_Nadiya[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function u2lkpy() {//兰卡拼音版
- var txt = " " + document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_chinese_pronounce_pinyin) {
- eval("txt=txt.replace(/" + char_chinese_pronounce_pinyin[u2s_i].id + "/g,char_chinese_pronounce_pinyin[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt.toLowerCase();
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function un2telugu() {
- var txt = document.getElementById("txtInput").value;
- output = "";
- try {
- for (u2s_i in char_unicode_to_telugu) {
- eval("txt=txt.replace(/" + char_unicode_to_telugu[u2s_i].id + "/g,char_unicode_to_telugu[u2s_i].value);");
- }
- }
- catch (err) {
- //error
- alert(err.message);
- }
- document.getElementById("txtOutput").value = document.getElementById("txtInput").value;
- document.getElementById("txtInput").value = txt;
- txt = document.getElementById("txtOutput").value;
- u2u()
- document.getElementById("txtInput").value = txt;
- }
- function run() {
- var input_opt = document.getElementById("input_str").value
- var output_opt = document.getElementById("output_str").value
- switch (input_opt) {
- case "1":
- s2u()
- break;
- case "2":
- u2u()
- break;
- case "3":
- sinhala2pali()
- break;
- case "4":
- myanmar_to_roman_1()
- break;
- case "6":
- tai_tham_to_roman()
- break;
- case "7":
- thai_to_roman()
- break;
- case "8":
- tai_old_to_roman()
- break;
- }
- txt0 = document.getElementById("txtInput").value
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- switch (output_opt) {
- case "1":
- u2s()
- break;
- case "2":
- u2u()
- break;
- case "3":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- u2sinhala1()
- break;
- case "4":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- u2sinhala2()
- break;
- case "4":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- u2lkcd()
- break;
- case "6":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- u2lkcs()
- break;
- case "7":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- u2cnnandiya()
- break;
- case "8":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- u2lkpy()
- break;
- case "9":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- un2telugu()
- break;
- case "10":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- roman_to_myanmar()
- break;
- case "11":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- roman_to_tai_tham()
- break;
- case "12":
- b2s()
- document.getElementById("txtInput").value = document.getElementById("txtOutput").value
- roman_to_thai()
- break;
- }
- document.getElementById("txtInput").value = txt0
- }
- </script>
- <style>
- .bg0 {
- background-color: #FF9;
- }
- .bg1 {
- background-color: #AAA;
- }
- </style>
- </head>
- <body class="mainbody" id="mbody"
- style="font-family: 'Noto Sans','Noto Sans CJK TC', 'Noto Sans CJK SC', 'Noto Sans TC', 'Noto Sans SC', 'Noto Sans CJK', Verdana, sans-serif; font-size:18px;">
- <!-- tool bar begin-->
- <div class='toolbar'>
- <script language="javascript">
- if (!g_is_mobile) {
- document.write("<button id=\"B_Navi\" onclick=\"setNaviVisibility()\" type=\"button\">≡</button> ");
- }
- </script>
- <script language="javascript">
- </script>
- <span id="debug"></span>
- </div>
- <!--tool bar end -->
- <div class="main" style="width:100%;height:100%;text-align:center; ">
- <div style="text-align:center; float:left;width:40%;height:80%;">
- My Text Is In<select id="input_str" style="align:center; float:down; font-size: 100%;margin:20px;">
- <option value="2">Pāli Roman Unicode</option>
- <option value="1">Sangayana</option>
- <option value="3">Sinhala</option>
- <option value="4">Myanmar1</option>
- <option value="5">Myanmar2</option>
- <option value="6">经典傣文</option>
- <option value="7">泰文</option>
- <option value="8">非Unicode傣文</option>
- </select></br>
- <textarea id="txtInput" rows="30" cols=""
- style="float:left; font-family: 'Noto Sans','Noto Sans CJK TC', 'Noto Sans CJK SC', 'ATaiThamKHNewV3-Normal', 'Noto Sans TC', 'Noto Sans SC', 'Noto Sans CJK', Verdana, sans-serif; font-size:16px; width:100%;height:100%;"></textarea>
- </div>
- <div style="text-align:center; float:left;width:15%;">
- </br></br></br></br></br></br></br></br></br></br></br></br>
- ṃ/ṁ/ŋ become
- <select id="m_str" style="align:center; font-size: 120%">
- <option value="ṃ,Ṃ">ṃ</option>
- <option value="ṁ,Ṁ">ṁ</option>
- <option value="ŋ,Ŋ">ŋ</option>
- </select>
- </br>
- </br>
- <button id="transfer" style="align:center; font-size: 200%; width:70px" type="button"
- onclick="run()">→</button>
- </div>
- <div style="text-align:center; float:left;width:40%;height:80%;">
- I Need the Text In<select id="output_str" style="align:center; float:down; font-size: 100%;margin:20px;">
- <option value="2">Pāli Roman Unicode</option>
- <option value="1">Sangayana</option>
- <option value="3">Sinhala1</option>
- <option value="4">Sinhala2</option>
- <option value="5">锡兰注音[详]</option>
- <option value="6">锡兰注音[简]</option>
- <option value="8">汉语拼音[锡]</option>
- <option value="9">Telugu</option>
- <option value="10">Myanmar</option>
- <option value="11">经典傣文</option>
- <option value="12">泰文</option>
- </select></br>
- <textarea id="txtOutput" rows="30" cols=""
- style="font-family: 'Noto Sans','Noto Sans CJK TC', 'Noto Sans CJK SC', 'ATaiThamKHNewV3-Normal', 'Noto Sans TC', 'Noto Sans SC', 'Noto Sans CJK', Verdana, sans-serif; font-size:16px; width:100%;height:100%"></textarea>
- </div>
- <div class="debugMsg" id="xmldata">
- <!--调试信息-->
- </div>
- <!--right side end-->
- </div>
- <div id="modifywin">
- </div>
- </body>
- </html>
|