get method with chinese character

Posted on 2009-04-22
Medium Priority
Last Modified: 2012-06-21
Dear ASP experts,

i'm trying to do a dictionary search, I'm using a get variable and retrieving the result with request.querystring, If I pass an english word it works fine, but if I pass a chinese character it returns question mark(?):

Eg 1.
the word value is tree

(I put chinese character "gong1")
the word value is ?

my codepage=65001and Response.CharSet = "utf-8".

Thanks in advance,

<% @ codepage=65001 %>
Response.CharSet = "utf-8"
getword = request.querystring("word")
response.write getword

Open in new window

Question by:perfectshark
1 Comment
LVL 12

Accepted Solution

Dimitris earned 2000 total points
ID: 24212490
Your problem is that you right the char directly to the Address Bar.
If you use the code bellow in IE you will see that the char is transited in URLEncode form
so for example the
} becomes %E3%81%BD
› becomes %E3%86%9B
u becomes %E3%89%B5 and so on

so if you call the page by submitting (as bellow) the url encode will work at its own
If you call it through ASP code then do this
Response.Redirect "mypage.asp?word="  & Server.URLEncode("My Characters.")
<%@Language="VBScript" codepage=65001%>
Response.CharSet = "utf-8"
getword = request.querystring("word")
response.write getword
<form  method =get >
	<input type=text id=word name=word>
	<input type=submit >

Open in new window


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question