John,


Using Witango/TeraScript with Unicode is tricky. There will be some situations 
where it just won’t do the right thing. Version 8 will finally correct this 
shortcoming.



The @CIPHER tag does have an undocumented (lightly documented?) function to 
ENCODE and DECODE to between the native 8859-1 and UTF-8 encoding.



TeraScript can only operate on 8859-1 strings. So let’s say, for example, you 
wanted to read file stored in UTF-8 and then use @TOKENIZE on it. You would 
have to first read the file (raw data) then run that variable through @CIPHER 
to transform it’s encoding to 8859-1, and then @TOKENIZE it.



Keep in mind that 8859-1 has a lot fewer characters in its set then UTF-8, so 
this process could lose data.



To answer your question directly, if you have a database with UTF-8 data in it. 
You are able to select from that database using TeraScript and then output that 
column data directly into the web page using @COLUMN. This should work as 
expected. Again, you can’t transform the data in any real way, but you can 
output it.



Finally, you need to tell the webpage that it contains UTF-8 data. This means 
placing the <meta http-equiv=”content-type” content=”text/html; charset=UTF-8”> 
tag on your webpage. (for HTML5 it’s just <meta charset=”UTF-8”>). 
Alternatively, you can alter the HTTPHEADER such that the Content-Type: header 
element contains the “; charset=UTF-8” portion.



So the two parts of the puzzle are to place UTF-8 encoded data on the webpage, 
and then telling the webpage that’s the encoding to use.



Let me know if you’d like me to look at a webpage that isn’t encoding 
correctly, or for more information on the use of @CIPHER to do these 
transcodings.



Robert









From: John Muldoon [mailto:webd...@cipromo.com]
Sent: Wednesday, February 20, 2013 8:43 AM
To: TeraScript-Talk@terascript.com
Subject: TeraScript-Talk: UTF-8



Hi folks,



I have been reading past mail archives for Tera and Wi and found some 
references to the <@cipher> tag on encoding and decoding UTF-8 characters. We 
have been able to get the database to show UTF-8 properly but was wondering on 
what the correct syntax would be to display the data on the return of a taf 
file. Possibly any other thoughts on getting this to work correctly. We were 
able to use an email function in the DB itself to email UTF-8 characters, but 
was also wondering about the Email in Tera and what caveats I need to address 
to get this to work properly.



Thanks!





  _____

To unsubscribe from this list, please send an email to lists...@terascript.com 
<mailto:lists...@terascript.com>  with "unsubscribe terascript-talk" in the 
body.




----------------------------------------

To unsubscribe from this list, please send an email to lists...@terascript.com 
with "unsubscribe terascript-talk" in the body.

Reply via email to