Load | Solve 1.<globalization
Requestencoding= "gb2312"
Responseencoding= "gb2312"
/>
Or
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
2. When downloading files, specify the filename, the Chinese filename appears garbled?
Response.AddHeader ("Content-disposition", "attachment; Filename= "+httputility.urlencoding" (filename. ToString ()));
3. How to identify whether the string contains Korean
http://search.csdn.net/Expert/topic/2456/2456407.xml?temp=.5485498
If only English and Korean
/******* This function returns characters in the string except English *********/
Create function test (@a varchar (20))
Returns varchar (20)
As
Begin
DECLARE @b varchar (m), @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
(The number of rows affected is 1 rows)
--1. Regarding the multinational writing, must use the Unicode judgment!
--2. Korean Unicode divided by two: 12592->12687 44032->55203
Related websites: 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
--Call:
declare @a nvarchar (100)
Set @a=n ' ABC 갃 country 123 '
Select DBO.HW (@a)
--return:1
Set @a=n ' ABC China 123 '
Select DBO.HW (@a)
--return:0
4. Why is the file read out of the Chinese character is garbled?
System.IO.StreamReader m_fs = System.IO.File.OpenText (Hfile_selectfile.value);
To
System.IO.StreamReader m_fs = new System.IO.StreamReader (hfile_selectfile.value,system.text.encoding.getencoding (" gb2312 "));
5.JMAIL email attachment or no or in the text is garbled
http://community.csdn.net/Expert/topic/3172/3172047.xml?temp=.3463404
6. How to solve the query string Chinese garbled problem?
Server.URLEncode Encoding for query content
String url = "Http://localhost/test/test.aspx?a=" + Server.URLEncode ("John");
Solution
-->server.urldecode ()