473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

AJAX for ASP with Chinese Character

12
Hi All,

I have use the ajax with the server side language ASP. I find the when passing the parameter with the chinese character, the chinese character cannot show orderly and become "wrong code" .

Anyone encounter this problem ?

For the javascript coding

Expand|Select|Wrap|Line Numbers
  1.     function createRequest()
  2.     {
  3.         try 
  4.         {
  5.             request = new XMLHttpRequest();
  6.         }
  7.         catch (trymicrosoft)
  8.         {
  9.             try
  10.             {
  11.                 request = new ActiveXObject("Msxml2.XMLHTTP");
  12.             }
  13.             catch (othermicrosoft)
  14.             {
  15.                 try
  16.                 {
  17.                     request = new ActiveXObject("Microsoft.XMLHTTP");
  18.                 }
  19.                 catch (failed)
  20.                 {
  21.                     request = null;
  22.                 }
  23.             }
  24.         }
  25.         if (request == null)
  26.         {
  27.             alert("Error creating request object!");
  28.         }
  29.     }
  30.  
  31.  
  32.  
  33.     function AddSummary(summary) {
  34.         createRequest();
  35.         var url="insert_summary.asp";
  36.         request.open("POST",url,true);
  37.         request.onreadystatechange = updateSummaryPage;
  38.         request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  39.         request.send("summary="+escape(summary));
  40.     }
  41.  
  42.  
  43.     function updateSummaryPage()
  44.     {
  45.         if (request.readyState==4)
  46.         {
  47.             document.getElementById("SummaryPage").innerHTML=request.responseText;
  48.         }
  49.     }
  50.  
For the ASP Coding

Expand|Select|Wrap|Line Numbers
  1. <%
  2.     Response.Charset="BIG5"
  3.     Response.ContentType="text/html"
  4.  
  5.  
  6.     Dim summary
  7.     summary = request("summary")
  8.     response.write "summary : " & summary & "<br>"
  9.  
  10.     ' And then Insert the summary into database
  11. %>
for the code :
Expand|Select|Wrap|Line Numbers
  1. response.write "summary : " & summary & "<br>"
I cannot get the correct word for traditional chinese character ?

Anyone can help me ?

Thanks and Regards,
stepby
Oct 10 '07 #1
1 2394
acoder
16,027 Expert Mod 8TB
Moved from Articles section. Please do not post questions in the Articles section. Thanks.

Please use code tags when posting code:

[CODE=javascript]
JavaScript code here....
[/code]
Oct 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Coco | last post by:
Hi! I managed to display chinese character in my web form (.aspx), in certain situation i need to to set the text of the label of my web form in chinese character programatically which is done in...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
8
by: Agnes | last post by:
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to...
8
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as...
1
by: CYF | last post by:
My Computer : Window XP Pro English Version -> I have set the "Regional" to "Taiwan" Mysql 4.1.x -- > set to big5 already i am using C# to program. When i retrieve chinese character from the...
0
by: Coco | last post by:
Hi! I have been searching for solution for the problem i am facing in displaying chinese character in my aspx page initially when i created the aspx page with some chinese chaarcter, it worked...
19
by: many_years_after | last post by:
Hi,everyone: Have you any ideas? Say whatever you know about this. thanks.
23
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars...
7
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
我们现在遇到一个问题,通过wcf创建的webservice,选择windows service作为宿主,采用java作为客户端调用成功,但是无法使用asp.net ajax调用。...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.