如何在西文ISO-8859-1页面上正确输入存储显示中文。
2008-01-28 15:44
330 查看
这篇文章是测试如何将西文页面上显示中文的,将Web.Config文件中的globalization节点修改为西文设置,
可以在页面显示编码为西文,那又如何能在此西文页面上显示存储中文信息呢,
建立ASPX页面进行测试:
后台代码:
这样就可以完成此功能。
如下为源代码: WebUnicodeTest
<globalization culture="en-US" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" />
可以在页面显示编码为西文,那又如何能在此西文页面上显示存储中文信息呢,
建立ASPX页面进行测试:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body onload="setTextValueFromHidden()"> <form id="form1" runat="server"> <input id="hidTxtContent" type="hidden" name="hidTxtContent" runat="server"> <asp:Label ID="lblValue" runat="server" Text="Label" ></asp:Label><div style="text-align: center"> <asp:TextBox ID="txtContent" runat="server" Height="262px" TextMode="MultiLine" Width="492px"></asp:TextBox> <br /> <br /> <asp:Button ID="btnConvert" runat="server" Text="escape" OnClick="btnConvert_Click" Height="24px" Width="59px" /> <br /> <br /> <br /> <asp:Button ID="Button1" runat="server" Text="Button" /></div> </form> </body> </html>
后台代码:
using System; using System.Data; using System.Text; using System.Text.RegularExpressions; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class UnicodeToGB2312 : System.Web.UI.Page
这样就可以完成此功能。
如下为源代码: WebUnicodeTest
相关文章推荐
- 如何让Zend Studio正确显示php页面中的中文字符
- c# 正确读取存储中文,以及如何获取字节流编码
- 如何解决Sublime Text 3不能正确显示中文的问题
- 如何让soureinsight正确显示中文
- 如何让xterm正确显示中文
- [Unity3D]手机3D游戏开发:如何实现最高分的存储与显示(七)----使用Game ID避免数据重复输入
- 如何解决Sublime Text 3不能正确显示中文的问题
- 如何让MAC OS X terminal bash 终端中vi显示并输入中文汉字
- D语言如何在windows的cmd下正确显示中文
- 如何解决 Sublime Text 3 不能正确显示中文的问题
- 如何让让英文Windows XP操作系统正确显示中文
- qt 编写的webkit程序发布的时候如何正确显示中文。
- 本人学习遇到的问题,mysql数据库存储图片中文路径页面不显示
- CEGUI OGRE ISO中文显示输入整合,鼠标独占问题,窗口创建
- 如何解决Sublime Text 3不能正确显示中文的问题
- Python绘图问题:Matplotlib中如何正确显示中文
- ssh框架里面添加数据时,jsp页面中文输入显示问号?解决方法
- android之WebView解决如何显示中文及使页面自适应手机分辨
- c# 正确读取存储中文,以及如何获取字节流编码
- phpmyadmin显示数据库中文正确php页面输出??乱码的解决方法