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

Request.QueryString() is stripping out French characters

Lu
Hi, i am currently working on ASP.Net v1.0 and is encountering the following
problem. In javascript, I'm passing in:
"somepage.aspx?QSParameter=<RowID>Chèques</RowID>" as part of the query
string. However, in the code behind when I tried to get the query string
value by calling Request.QueryString("QSParameter"), the value I got is:
"<RowID>Chques</RowID>". The special character "è" has been stripped out.
The web.config file is currently set to use UTF-8 for request, response, and
file encoding. What could be causing characters like "è" to be stripped out
of the query string in the code behind? Do I need to set some other value or
use some special processing code? Thanks.
Nov 19 '05 #1
4 6628
Lu:

Open your aspx page and select "Save <<page name>> As..." The Save
button in the dialog should have a down arrow at the right of the
button. Click this and select "Save With Encoding". You will be asked
if you want to overwrite the file. Click Yes to this. You will then
get a dialog asking you to select Endcoding and Line Endings. Leave the
Line Endings alone, but select the "Unicode - Codepage 1200" option and
save the file.

What is happening is VS.NET is saving your aspx file an an ASCII file,
which only has one byte per character and as such cannot support foreign
language character sets. When you save it with encoding, it will save
it as a text file, but it will keep the second Unicode byte with the
file.

John

-----Original Message-----
From: Lu [mailto:Lu@discussions.microsoft.com]
Posted At: Wednesday, August 31, 2005 2:20 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Request.QueryString() is stripping out French characters
Subject: Request.QueryString() is stripping out French characters
Hi, i am currently working on ASP.Net v1.0 and is encountering the
following problem. In javascript, I'm passing in:
"somepage.aspx?QSParameter=<RowID>Chèques</RowID>" as part of the query
string. However, in the code behind when I tried to get the query
string value by calling Request.QueryString("QSParameter"), the value I
got is:
"<RowID>Chques</RowID>". The special character "è" has been stripped
out.
The web.config file is currently set to use UTF-8 for request, response,
and file encoding. What could be causing characters like "è" to be
stripped out of the query string in the code behind? Do I need to set
some other value or use some special processing code? Thanks.

Nov 19 '05 #2
John Horst wrote:
Lu:

Open your aspx page and select "Save <<page name>> As..." The Save
button in the dialog should have a down arrow at the right of the
button. Click this and select "Save With Encoding". You will be
asked if you want to overwrite the file. Click Yes to this. You
will then get a dialog asking you to select Endcoding and Line
Endings. Leave the Line Endings alone, but select the "Unicode -
Codepage 1200" option and save the file.
That won't help, but rather be harmful, without changing the
fileEncoding attribute in web.config to UTF-16LE. Since Lu's already
using UTF-8, this is a waste of time. The files must be stored as UTF-8
instead.
What is happening is VS.NET is saving your aspx file an an ASCII file,
which only has one byte per character and as such cannot support
foreign language character sets. When you save it with encoding, it
will save it as a text file, but it will keep the second Unicode byte
with the file.


That's not correct. ASP.NET seems to use the platform's default
encoding if no fileEncoding is specified, just like VS .NET does. I say
"seems", because that behaviour isn't documented.

If that platform default is for example Windows-1252, you can easily
save many special characters used in Western Europe natively in your
source files.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #3
Lu
Hi, for this page, what we do is that we have an XML control on the ASPX
which we use to dynamically create a table based on data returned from our
business objects. This dynamic table that we render contains texts and
numbers that the user can click on to go a pop up that will show more info.
When the user clicks on the link, the javascript grabs the necessary
information from the dynamically render page and pass them as query string
parameters. So, the string "Chèques" is part of the data that is returned
from our business object and dynamically rendered on the screen. The string
is also used in the query string parameter when the user clicks on
appropriate link. What is happening now is that the page renders properly
with the correct text. The javascript is grabbing the correct test and
calling the popup window ASPX page with the correct query string parameter.
So if I put an alert() call in the javascript, I will see
"<RowID>Chèques</RowID>". However, when the popup window ASPX page's code
behind Page_Load() is called, the call to Request.QueryString() returns
"<RowID>Chques</RowID>". In the web.config, I have request, response, and
file encoding set to utf-8. So it seems like somewhere between when the page
is submitted, and the Page_Load() event is fired, the "è" character was
removed for some reason. The ASP.Net project is currently on framework v1.0
and upgrading is not an option currently.

Also, I have Window-1252 character code page installed according to
"Regional and Language Options" in control panel. Not sure how to set it as
the default code page though.

Any ideas or suggestions to solve this problem would be greatly appreciated.
Thanks.

"Joerg Jooss" wrote:
John Horst wrote:
Lu:

Open your aspx page and select "Save <<page name>> As..." The Save
button in the dialog should have a down arrow at the right of the
button. Click this and select "Save With Encoding". You will be
asked if you want to overwrite the file. Click Yes to this. You
will then get a dialog asking you to select Endcoding and Line
Endings. Leave the Line Endings alone, but select the "Unicode -
Codepage 1200" option and save the file.


That won't help, but rather be harmful, without changing the
fileEncoding attribute in web.config to UTF-16LE. Since Lu's already
using UTF-8, this is a waste of time. The files must be stored as UTF-8
instead.
What is happening is VS.NET is saving your aspx file an an ASCII file,
which only has one byte per character and as such cannot support
foreign language character sets. When you save it with encoding, it
will save it as a text file, but it will keep the second Unicode byte
with the file.


That's not correct. ASP.NET seems to use the platform's default
encoding if no fileEncoding is specified, just like VS .NET does. I say
"seems", because that behaviour isn't documented.

If that platform default is for example Windows-1252, you can easily
save many special characters used in Western Europe natively in your
source files.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 19 '05 #4
Lu wrote:
Hi, for this page, what we do is that we have an XML control on the
ASPX which we use to dynamically create a table based on data
returned from our business objects. This dynamic table that we
render contains texts and numbers that the user can click on to go a
pop up that will show more info. When the user clicks on the link,
the javascript grabs the necessary information from the dynamically
render page and pass them as query string parameters. So, the string
"Chèques" is part of the data that is returned from our business
object and dynamically rendered on the screen. The string is also
used in the query string parameter when the user clicks on
appropriate link. What is happening now is that the page renders
properly with the correct text. The javascript is grabbing the
correct test and calling the popup window ASPX page with the correct
query string parameter. So if I put an alert() call in the
javascript, I will see "<RowID>Chèques</RowID>". However, when the
popup window ASPX page's code behind Page_Load() is called, the call
to Request.QueryString() returns "<RowID>Chques</RowID>". In the
web.config, I have request, response, and file encoding set to utf-8.
So it seems like somewhere between when the page is submitted, and
the Page_Load() event is fired, the "è" character was removed for
some reason. The ASP.Net project is currently on framework v1.0 and
upgrading is not an option currently.


I guess that the JavaScript code uses a different encoding internally
when fetching the popup page. You could use a debugging proxy like
Fiddler (www.fiddlertool.com) to monitor your HTTP traffic.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #5

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

Similar topics

11
by: David | last post by:
Hi, I'm trying to pass a querystring with certain common words removed (and, the, if, of etc). The code below replaces the keywords with "" or whatever I choose, but what I'd like to do is...
0
by: Samuel Fung | last post by:
Hi all, Can ASP retrieve UTF-8 encoded data in query string properly, when used with IIS 5.0 on Windows 2000 Pro/Server? With some trial and error, it seems that adding the directive...
4
by: SP | last post by:
Hi I have a problem with a customer's XML being submitting to me in a non-well-format XML. They said that there are 18 other partners who has been able to tweak the XML to make it work. So I...
10
by: William L. Bahn | last post by:
I'm looking for a few kinds of feedback here. First, there is a program at the end of this post that has a function kgets() that I would like any feedback on - including style. Second, for...
2
by: Navanith | last post by:
Hi, I wrote a simple aspx page that dumps query string to the browser. Following is the globalization section in web.config <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
2
by: phl | last post by:
Hello, I have aspx(say page.aspx) page which uses javascript to submit a form reload with some unicode characters,upon an button event e.g page.aspx?param=value I get this value in the...
0
by: dolittle | last post by:
Hi, I`m using a server that receive a GET request with a query string that contains double-byte non-latin characters: http://www.example.com?%d7%90 and the java code: String queryString...
2
by: Doogie | last post by:
Hi, I'm writing Javascript code to parse out a query string. I want to handle the case where a parameter value may not be sent. So consider a parameter called "State". If the user doesn't pass...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.