char(4) not replaceable?

Brian Yennie briany at qldlearning.com
Wed Apr 21 19:18:07 EDT 2004


Sannyasin,

I don't know if this is something you already have a handle on, but the 
first thing to know about Unicode is that each character is _two_ bytes 
instead of one, so some of this weird pasting behavior happens because 
the receiving application treats the two bytes as two consecutive 
characters.

The reason why, most likely, you think you are getting a valid ASCII 
number but not seeing a valid ASCII character is because you are 
actually testing the charToNum() of a two character string- and 
charToNum() only considers the first character.

For example, charToNum("apple") is the same as charToNum("a"), even 
though they are obviously different strings to the human eye.

HTH!

> Unicode? could be... frankly I'm getting out of my depth now on 
> character encodings and feel like going to school on this one to get 
> up to speed. All kinds of wierdness now like characters pasted from 
> Indesign turning into Osaka on OSX and also when pasted into REV ( and 
> BBEdit too...) but then if you query for what the ascii is you get 
> something that should be a regular character in the font that is set 
> for the field...
>
> I run TIDY on an BBEdit HTML file and Tidy goes nuts. If I just change 
> the config to output UTF-8 instead of UTF-16, then it will process the 
> file just fine... complete mystery... another html file, looks almost 
> exactly the same, will process out under UTF-16, no problem... I don't 
> see the diff between the two files...



More information about the use-livecode mailing list