#char-convert
Bookmarklet for convert wrong type language from English to Thai.
##Prepare
- Turn on bookmark or favorite toolbar. (Instruction for Firefox, Google Chrome, Internet Explorer)
- Left Click on toolbar that you has just turn on to add new bookmark.
- Type "char-convert" for the name of new bookmark.
- Copy this code to new bookmark url/location.
javascript:(function(){var en=["1","2","3","4","5","6","7","8","9","0","-","=","\\","!","@","#","$","%","^","&","*","(",")","_","+","|","q","w","e","r","t","y","u","i","o","p","[","]","Q","W","E","R","T","Y","U","I","O","P","{","}","a","s","d","f","g","h","j","k","l",";","'","A","S","D","F","G","H","J","K","L",":","\"","z","x","c","v","b","n","m",",",".","/","Z","X","C","V","B","N","M","<",">","?"],th=["ๅ","/","-","ภ","ถ","ุ","ึ","ค","ต","จ","ข","ช","ฃ","+","๑","๒","๓","๔","ู","฿","๕","๖","๗","๘","๙","ฅ","ๆ","ไ","ำ","พ","ะ","ั","ี","ร","น","ย","บ","ล","๐","\"","ฎ","ฑ","ธ","ํ","๊","ณ","ฯ","ญ","ฐ",",","ฟ","ห","ก","ด","เ","้","่","า","ส","ว","ง","ฤ","ฆ","ฏ","โ","ฌ","็","๋","ษ","ศ","ซ",".","ผ","ป","แ","อ","ิ","ื","ท","ม","ใ","ฝ","(",")","ฉ","ฮ","ฺ","์","?","ฒ","ฬ","ฦ"],result='',strInput=window.getSelection().toString();if(strInput=='')strInput=prompt("Insert text for convert to right Thai characters.");if(strInput != ''){for (i=0;i<strInput.length;i++){if(strInput.charCodeAt(i)==10)result+='\n';else{for(j=0;j<92;j++){if(strInput.charAt(i)==en[j]){result+=th[j];break;}}if(j==92)result+=strInput.charAt(i);}}alert(result);}})();
Click save or add this new bookmarklet.
##How to use
- Drag the wrong words that you want to changed.
- Click "char-convert" bookmarklet on bookmark or favorite toolbar.
- If you not selected words. It will show popup the input field and you may type the words manually.
- The characters that convert to Thai successful will show in the new popup.
- Can convert wrong English character to Thai by selection words.