亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Asp.net中的頁(yè)面亂碼的問(wèn)題

 更新時(shí)間:2006年09月28日 00:00:00   作者:  
1.<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/>

或者

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


2.下載文件時(shí)指定文件名,中文的文件名出現(xiàn)了亂碼?

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




3.如何識(shí)別字符串中是否包含韓文

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

如果只有英文和韓文
/*******該函數(shù)返回字符串中除英文外的字符*********/
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

(所影響的行數(shù)為 1 行)
--1.有關(guān)多國(guó)文字的,一定要用UNICODE判斷!
--2.韓文UNICODE分兩斷: 12592->12687 44032->55203
相關(guān)網(wǎng)站: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

--調(diào)用:
declare @a nvarchar(100)
set @a=N'abc中갃國(guó)123'
select dbo.hw(@a)

--return: 1


set @a=N'abc中國(guó)123'
select dbo.hw(@a)

--return: 0




4.為什么文件讀出來(lái)的中文字符是亂碼?

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 發(fā)郵件附件或者沒(méi)有或者在正文中是亂碼

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

6.怎么解決查詢字符串中文亂碼問(wèn)題?

查詢內(nèi)容用Server.UrlEncode編碼

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

-->Server.UrlDecode()

相關(guān)文章

最新評(píng)論