Japanese chars in HTML result [WAS: tips on posting an url and reading the results]

Ken Corey ken at kencorey.com
Sat Feb 4 01:58:52 EST 2012


On 04/02/2012 05:14, Bob Sneidar wrote:
> So the trick is to programmatically determine what is double byte and what is not?

Well, if you take a look at the headers from that page, the 
Content-Type: "text/html; charset=UTF-8"

Which is specifies exactly how the data will fall:
http://en.wikipedia.org/wiki/UTF-8

For regular ascii characters, nothing changes. For the higher ranges, 
you could have 2 to 4 bytes per character.

http://runrev.com/newsletter/december/issue62/newsletter2.php

I've not tried it, but I think your solution is something like this:

    put "https://www.googleapis.com/books/ETC"  into tURL
    get url tURL
    set the unicodeText of field X to uniencode(it,"UTF8")

As I understand it, you've got to get the text from UTF8 into the 
internal representation of a string.  Then, for the field to understand 
it and display it properly, you must put the string into the unicodeText 
of it.

Hope that helps.

-Ken




More information about the use-livecode mailing list