title: Unicode, VBScript and HTML
body: <p>I have the following radio box: 
  <code>&lt;input type="radio" value="&amp;#39321;"&gt;&amp;#39321;&lt;/input&gt;</code></p>
  
  <p>As you can see, the value is unicode. It represents the following Chinese character: &#39321;</p>
  
  <p>So far so good.
  I have a VBScript that reads the value of that particular radio button and saves it into a variable. When I display the content with a message box, the Chinese Character appears. Additionally I have a variable called uniVal where I assign the unicode of the Chinese character directly:</p>
  
  <pre><code>radioVal = &lt; read value of radio button &gt;
  MsgBox radioVal  ' yields chinese character
  uniVal = "&amp;#39321;"
  MsgBox uniVal   ' yields unicode representation
  </code></pre>
  
  <p>Is there a possibility to read the radio box value in such a way that the unicode string is preserved and NOT interpreted as the chinese character?</p>
  
  <p>For sure, I could try to recreate the unicode of the character, but the methods I found in VBScript are not working correctly due to VBScripts implicit UTF-16 setting (instead of UTF-8). So the following method does not work correctly for all characters:</p>
  
  <pre><code>Function StringToUnicode(str)
      result = ""
      For x=1 To Len(str)
          result = result &amp; "&amp;#"&amp;ascw(Mid(str, x, 1))&amp;";"
      Next
      StringToUnicode = result
  End Function
  </code></pre>
  
  <p>Cheers
  Chris</p>