title: Using Tcl encoding command to convert from Traditional Chinese to Simplified Chinese
body: <p>I support a website written in Tcl which displays data in Traditional Chinese (big5).  We then have a Java servlet, using the translation code from mandarintools.com, to translate a page request into Simplified Chinese.  The conversion as specified to the translation code is from UTF-8 to UTF-8S;  Java is apparently correctly translating the data to UTF-8 as it comes in.</p>
  
  <p>The Java translation code works but is slow, and since the website is written in Tcl someone on another list suggested I try using that.  Unfortunately, Tcl doesn't support UTF-8S and I have been unable to figure out what translation to use in its place.  I've tried gb2312, gb2312-raw,gb1988, euc-cn... all result in gibberish.  My assumption is that Tcl is also translating to UTF-8 as it comes in, though I have tried converting from big5 first and it doesn't help.</p>
  
  <p>My test code looks like this:</p>
  
  <pre><code>set page_body [ns_httpget http://www.mysite.com]
  set translated_page_body [encoding convertto gb2312 $page_body]
  ns_write $translated_page_body
  </code></pre>
  
  <p>I have also tried </p>
  
  <pre><code>set page_body [ns_httpget http://www.mysite.com]
  set translated_page_body [encoding convertto gb2312 [encoding convertfrom big5 $page_body]]
  ns_write $translated_page_body
  </code></pre>
  
  <p>But it didn't change anything.</p>
  
  <p>Does anyone out there have enough experience with this to help me figure it out?</p>