如何从文本框中获取unicode文本 [英] How to get unicode Text from textbox

查看:95
本文介绍了如何从文本框中获取unicode文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在文本框中使用bamini字体。我需要将unicode值传递给insert。但我无法得到它。它作为英语反复。例如,如果我在文本框中键入值தமிழ்。我对我的代码嗤之以鼻。价值已经过了?????或者dgfmd。



帮我搞定。

Hi

I'm using bamini font to my textbox. i need to pass the unicode value to insert. But i could not get it. its retrive as english . for example if i type the value "தமிழ்" in a textbox. i put a brak on my code. the value has passed like "?????" or dgfmd.

Help me to get it.

推荐答案

在你的web.config文件中添加下一个设置:



In your web.config file add the next settings:

<globalization>
 requestEncoding="utf-8"
 responseEncoding="utf-8"
 fileEncoding="Unicode" />
</globalization>


尝试

Try
byte[] bytes = System.Text.Encoding.Unicode.GetBytes(strg);
foreach(byte b in bytes) {
     Console.Write("{0:x2}", b);
}


这篇关于如何从文本框中获取unicode文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆