Steve Minutillo has created a bookmarklet that converts non-ASCII characters to HTML entities. A very sweet bookmarklet. If you're running IE 5.5+, Mac or PC, Mozilla 1.2 (Mac and PC). I haven't gotten it to work on Safari. But it is slick. ( via Antipixel )
Hmm... it works for me. I just typed those characters directly and then used the bookmarklet to convert them to entities. Remember, it only encodes characters in textareas and text input fields.
Comments
steve
Let's see if it works in Safari:
你好嗎
Hmm... it works for me. I just typed those characters directly and then used the bookmarklet to convert them to entities. Remember, it only encodes characters in textareas and text input fields.
Posted by: steve | May 19, 2003 07:05 PM
Tony
I can't make it work for the life of me in Safari. I get nothing. Tried in textareas and input.
But I figured it out. When I added the link as a bookmarklet in Safari, it converted things for me.
javascript:(function()%7Bfunction%20entities(e)%7Bf=e.value;t='';for(i=0;i%3Cf.length;i++)%7Bif(f.charCodeAt(i)%3E127)%7Bt+='&%23'+f.charCodeAt(i)+';';%7Delse%7Bt%20+=%20f.charAt(i);%7D%7De.value=t;%7Dl=document.getElementsByTagName('textarea');for(j=0;j%3Cl.length;j++)%7Bentities(l%5Bj%5D)%7Dl=document.getElementsByTagName('input');for(j=0;j%3Cl.length;j++)%7Bif(l%5Bj%5D.type=='text')entities(l%5Bj%5D)%7D%7D)()
is the code I got in Safari.
Posted by: Tony | May 20, 2003 07:02 AM