JqueryQrcode生成二维码不支持中文的解决办法

function utf16to8(str) {

var out, i, len, c;<br/>
out = &#34;&#34;;<br/>
len = str.length;<br/>
for(i = 0; i &lt; len; i++) {<br/>
c = str.charCodeAt(i);<br/>
if ((c &gt;= 0x0001) &amp;&amp; (c &lt;= 0x007F)) {<br/>
    out += str.charAt(i);<br/>
} else if (c &gt; 0x07FF) {<br/>
    out += String.fromCharCode(0xE0 | ((c &gt;&gt; 12) &amp; 0x0F));<br/>
    out += String.fromCharCode(0x80 | ((c &gt;&gt;  6) &amp; 0x3F));<br/>
    out += String.fromCharCode(0x80 | ((c &gt;&gt;  0) &amp; 0x3F));<br/>
} else {<br/>
    out += String.fromCharCode(0xC0 | ((c &gt;&gt;  6) &amp; 0x1F));<br/>
    out += String.fromCharCode(0x80 | ((c &gt;&gt;  0) &amp; 0x3F));<br/>
}<br/>
}<br/>
return out;<br/>

}