473,385 Members | 1,445 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,385 software developers and data experts.

UrlEncode - UrlDecode problem: not symmetric

Hi,
I have a problem with UrlEncoding/UrlDecoding.

I have two chars (東京);
the HTTPUtility.UrlEncode writes in the html the text:
%e6%9d%b1%e4%ba%ac

The Request.Querystring.ToString() of the called page returns:
%u00e6%u009d%u00b1%u00e4%u00ba%u00ac

and after having UrlDecoded I obtain the text
東京

I don't know what's the problem... How should I do to obtain the
original text using UrlEncode and Decode?
I've posted the problem on asp.net forums too but didn't finad any
solution...
Thank you very much in advance for any idea!

Mar 14 '07 #1
1 3010
On Mar 14, 7:39*pm, "lookaround" <lookaro...@virgilio.itwrote:
Hi,
* * I have a problem with UrlEncoding/UrlDecoding.

I have two chars (東京);
the HTTPUtility.UrlEncode writes in the html the text:
%e6%9d%b1%e4%ba%ac

The Request.Querystring.ToString() of the called page returns:
%u00e6%u009d%u00b1%u00e4%u00ba%u00ac

and after having UrlDecoded I obtain the text
*東京

I don't know what's the problem... How should I do to obtain the
original text using UrlEncode and Decode?

I've posted the problem on asp.net forums too but didn't finad any
solution...
Thank you very much in advance for any idea!
It is symmetric.

Response.Write(
System.Web.HttpUtility.UrlDecode(
System.Web.HttpUtility.UrlEncode(
"東京")));

Output: 東京

It looks like you encode or decode the string more than one time

Mar 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DC Gringo | last post by:
I am having trouble building a URL the serves up an image dynamically...something involving the & separating my URL parameters. If I put the same URL in with & instead of the code-generated &amp;,...
3
by: Doug Johnston | last post by:
Hi, I am having problems with running urlencode(select * from myfile where field like '%0002%'), in particular the like section, what I get is... like+%27%250002%25%27 ....which is fine, but...
5
by: elyob | last post by:
Quite a lot of my data has apostrophes in. I'm passing the data using $_POST and urlencode. So, for example, Joe's becomes Joe%27s. On the next page, I urldecode and display the name in the META...
0
by: Chris | last post by:
Just a curiosity: Is it standard practice to UrlEncode and UrlDecode cookie values? I wouldn't have even stumbled across this except I noticed that when I retrieve a cookie that was set with...
2
by: Grey | last post by:
How can I use the URLEncode in ASP.NET?? If i used URLEncode to encode the URL, how can I decode the URL with proper parameter values in ASP.NET?? I can encode the URL, but i cannot decode it...
2
by: Nic | last post by:
Hello all, I ran into a problem encoding/decoding special characters in URLs. by using Server.UrlEncode and Server.UrlDecode. Basically, encoding x+y results in x%2by, however decoding x%2by...
2
by: Marc Cardinal | last post by:
I have a need to encode and decode url content. I'm currently using the UrlDecode and UrlEncode methods from the HttpUtility class. However the code must be able to run under the .Net Internet...
0
by: darrel | last post by:
I'm trying to pass a text string via a querystring. I'm using URLEncode to pass it and URLDecode to grab it. This works, unless the string has an apostrphy in it. Is there a reason that...
6
by: CindyH | last post by:
Hi I'm not sure whether I should send this as a new message or use the one I've been using but... I'm using vb.net 2.0 - My problem is I need to send something like this: 'dim encodedstring =...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.