我想做一个页面语言转换的功能,通过改变页面的ENCODE编码格式让同一网页可以用不同国家的语言进行显示,以下是我实现功能的代码:
protected void Page_Load(object sender, EventArgs e)
{
string name=Request.QueryString["name"];
if (name != null)
{
Encoding encode = Encoding.GetEncoding(name);
Response.ContentEncoding = encode;
}
}
//页面编码转换成中文gb2312
protected void Button1_Click(object sender, EventArgs e)
{ string path = Request.Path+"?name=gb2312";
Response.Redirect(path);
}
//页面编码转换成日文shift-JIS
protected void Button2_Click(object sender, EventArgs e)
{
string path = Request.Path + "?name=shift-JIS";
Response.Redirect(path);
}
能进行转换,但是我转换的是日文,结果出乱码,转换回来就没事,请问我该怎么叫他能用各国语言显示我的页面而不出现乱码???
protected void Page_Load(object sender, EventArgs e)
{
string name=Request.QueryString["name"];
if (name != null)
{
Encoding encode = Encoding.GetEncoding(name);
Response.ContentEncoding = encode;
}
}
//页面编码转换成中文gb2312
protected void Button1_Click(object sender, EventArgs e)
{ string path = Request.Path+"?name=gb2312";
Response.Redirect(path);
}
//页面编码转换成日文shift-JIS
protected void Button2_Click(object sender, EventArgs e)
{
string path = Request.Path + "?name=shift-JIS";
Response.Redirect(path);
}
能进行转换,但是我转换的是日文,结果出乱码,转换回来就没事,请问我该怎么叫他能用各国语言显示我的页面而不出现乱码???
解决方案 »
- 求弹出窗口大全,在网上搜索了半天,没有搜到,大侠们给个链接。
- 完全禁用viewstate的情况下获取页面的值
- 大侠们求救 ASPxGridView 加载时候不自动选择项?
- a href传递多个绑定的问题希望这个贴子你在短时间内有更多人参与
- |zyciis| Session占用多大的资源呢 我和同事争要用Session还是用Cookies 谢谢
- 字段格式转换问题
- asp.net 会员密码加密
- 点击删除时要求弹出一个删除确认框为什么只能第二次时才可以弹出呢??
- 怎样控制textbox,我只要数字。???
- 使用HttpModule记录当前登陆人的ID
- .net中通常如何实现像ASP中的include嵌入文件的功能??
- 在本地成功运行,发布到服务器却出现出现异常,这种异常怎样处理?
浏览器又不会自己翻译
Response.urlEncode