1.<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/>
or<META http-equiv="content-type" content="text/html; charset=gb2312">
2. When downloading the file, specify the file name. Is there a garbled code in the Chinese file name?
("Content-Disposition", "attachment; filename="+( ()));
3. How to identify whether a string contains Korean
/Expert/topic/2456/?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(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 ('aabc12dsa451')
--------------------
12451
(The number of rows affected is 1 row)--1. For multinational characters, you must use UNICODE to judge!
--2. Korean UNICODE is divided into two parts: 12592->12687 44032->55203
Related websites: ./
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'abcChina123'
select (@a)
--return: 1
set @a=N'abcChina 123'
select (@a)
--return: 0
4. Why are the Chinese characters read from the file garbled?
m_fs = (Hfile_SelectFile.Value);
Change to m_fs = new (Hfile_SelectFile.Value,("gb2312"));
Email attachments are either not available or are garbled in the text
/Expert/topic/3172/?temp=.3463404
6. How to solve the problem of garbled Chinese in query strings?
Encoding content
string url ="http://localhost/test/?a="+ ("Zhang San");
untie
-->()