All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET,2.0,里输出文本格式流_.net资料_编程技术
叩开C#之门系列之几个重要名词_[Asp.Net教程]
C#教程:读取注册表信息
新瓶旧酒ASP.NET,AJAX(5),-,客户端脚本编程(Sys.UI命名空间下的类和快捷方法)_[Asp.Net教程]
PHP中用正则表达式验证中文的问题_[PHP教程]
Asp.net下实现隐藏真实下载地址(可以实现简单的防盗链)_[Asp.Net教程]
asp.net2.0验证控件之ValidationSummary控件使用方法详
不一样的项目,不一样的PHP_php资料_编程技术
delphi弹出菜单组件(TPopMenu)
ASP.NET Remoting体系结构(一)
Reading number is top 10 pictures
The money of more than 100 countries and regions20
The real super beauty14
Chinese paper-cut grilles art appreciation3
青春清纯美女大集合1
BingBingFan apple dew point photo gallery5
Look for from human art net, is good--2
Is said to be a Chinese female artist fame explicit pictures before2
男人帮杂志里的惹火性感美女2
More attractive than sora aoi4
Exquisite decoration is not paying too much3
Download software ranking
软件工程思想
功夫熊猫2(上集)
网络管理员第三版
C#与.NET技术平台实战演练
C#编程思想
传奇私服架设教程-chm
Sora aoi 120 minutes
Unix video tutorial11
VeryCD电驴(EasyMule) V1.1.9 Build09081
Tram sex maniac 2 (H) rar bag9
delv published in(发表于) 2014/1/6 9:02:55 Edit(编辑)
Asp.net中的页面乱码的问题_[Asp.Net教程]

Asp.net中的页面乱码的问题_[Asp.Net教程]

Asp.net中的页面乱码的问题_[Asp.Net教程]

























1.<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/>



或者






<META http-equiv="content-type" content="text/html; charset=gb2312">




2.下载文件时指定文件名,中文的文件名出现了乱码?






Response.AddHeader("Content-Disposition", "attachment; filename="+HttpUtility.UrlEncoding(filename.ToString ()));






3.如何识别字符串中是否包含韩文

http://search.csdn.net/Expert/topic/2456/2456407.xml?temp=.5485498

如果只有英文和韩文





/*******该函数返回字符串中除英文外的字符*********/
create function test(@a varchar(20))
returns varchar(20)
as
begin
declare @b varchar(20),@i int
set @b = ''
set @i = 1
while @i<= len(@a)
begin
if Upper(substring(@a,@i,1)) not between 'A' and 'Z'
set @b = @b + substring(@a,@i,1)
set @i = @i+1
end
return @b
end

Select dbo.test('aabc12dsa451')


--------------------
12451



(所影响的行数为 1 行)
--1.有关多国文字的,一定要用UNICODE判断!
--2.韩文UNICODE分两断: 12592->12687 44032->55203
相关网站:http://www.buja.8u8.com/eeeeee.htm







create function hw(@str Nvarchar(100))
returns int
as
begin
declare @a int
set @a=0
while @str<>'' and @a=0
begin
set @a=(case when unicode(left(@str,1)) between 12592 and 12687
or unicode(left(@str,1)) between 44032 and 55203
then 1
else 0 end)
set @str=right(@str,len(@str)-1)
end
return @a
end

--调用:
declare @a nvarchar(100)
set @a=N'abc中갃国123'
select dbo.hw(@a)

--return: 1


set @a=N'abc中国123'
select dbo.hw(@a)

--return: 0






4.为什么文件读出来的中文字符是乱码?






System.IO.StreamReader m_fs = System.IO.File.OpenText(Hfile_SelectFile.Value);


改为





System.IO.StreamReader m_fs = new System.IO.StreamReader(Hfile_SelectFile.Value,System.Text.Encoding.GetEncoding("gb2312"));




5.JMAIL 发邮件附件或者没有或者在正文中是乱码

http://community.csdn.net/Expert/topic/3172/3172047.xml?temp=.3463404

6.怎么解决查询字符串中文乱码问题?

查询内容用Server.UrlEncode编码

string url ="http://localhost/test/test.aspx?a="+ Server.UrlEncode("张三");

-->Server.UrlDecode()




来源:网络转载












































添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.