unicode from a rev cgi

Jim Sims sims at ezpzapps.com
Wed Dec 31 12:16:43 EST 2008


On Dec 31, 2008, at 6:04 PM, Devin Asay wrote:

> If you get the text back as html entities like this you may have to  
> add in the font tags in your scripting. It would probably be  
> sufficient to note which tags are added when you do it locally and  
> prepend/append them. The one trick is that the space character is  
> not unicode, so you'd have to surround each word by font tags.   
> Here's what I came up with when I did a quick test (beware line  
> wrapping):
>
>
> put "μικρό άλογο"  
> into decodedText
>   repeat for each word tWord in decodedText
>      put "<font face=" &quote& "Geneva" &quote && "lang=" &quote&  
> "en-UC" & quote & ">" before tWord
>      put "</font>" after tWord
>      put tWord & space after taggedText
>   end repeat
>   put taggedText--> yields: <font face="Geneva" lang="en- 
> UC">μικρό</font> <font face="Geneva"  
> lang="en-UC">άλογο</font>
>   set the htmltext of fld 1 to taggedText
>
> (Ugly, I know, but it works.)


Thanks for the reply Devin.

Yup, I've stumbled upon the adding font tags workaround/hack. That  
brings up a question
of what tags to add if the user is not speaking english. The tag  
"lang=en-UC"
implies to me that the "en" is for english. Perhaps that does not make  
any difference
and I can use that tag even if the user is Dutch? The display of the  
text should
be the same no matter the language of the viewer I suppose.


> As an alternative, would it be possible to encode the unicode text  
> from the form as UTF-8 before saving it to the text file? At least  
> it would be a bit cleaner that way.

Thanks for providing this direction to my research on the issue. Might
be a winner  ;-)

sims

sims at ezpzapps.com
Skype:   sims.jim
iChat:   techietours
______________________
Opportunity by Design







More information about the use-livecode mailing list