469,271 Members | 1,270 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Querystring with accented characters

I have encountered a problem when certain European characters are included in
the Querystring of an URL.

If I have a URL like: ?param=AA*

On the receiving page a simple Request() call returns "AA" and not "AA*".

It drops all accented characters!

If I change to use a Form instead, it works OK.

If I copy the Request.QueryString to a String variable and split it I manage
to get the proper value.

I have tried this on Windows 2000 and Windows 2003 with the same result.

Is this a known bug with Request.QueryString? And if so is there a
fix/workaround??

Thanks

John Byrne
Australia
Jul 22 '05 #1
10 4068
No issues on my end. Have you tried a different browser? Does it appear
right in a view-source? Have you tried URLEncoding it?

Ray at home
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
I have encountered a problem when certain European characters are included
in
the Querystring of an URL.

If I have a URL like: ?param=AA

On the receiving page a simple Request() call returns "AA" and not "AA ".

It drops all accented characters!

If I change to use a Form instead, it works OK.

If I copy the Request.QueryString to a String variable and split it I
manage
to get the proper value.

I have tried this on Windows 2000 and Windows 2003 with the same result.

Is this a known bug with Request.QueryString? And if so is there a
fix/workaround??

Thanks

John Byrne
Australia

Jul 22 '05 #2
This is an ASP Request object problem. Different browser makes no difference.

Getting parameters on the server side behaves differently depending on how
the ASP page was requested.

It works as expected when a form is submitted, but if the page is requested
via URL then Request("<parm>") doesn't return accented characters.

Thanks

"Ray Costanzo [MVP]" wrote:
No issues on my end. Have you tried a different browser? Does it appear
right in a view-source? Have you tried URLEncoding it?

Ray at home
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
I have encountered a problem when certain European characters are included
in
the Querystring of an URL.

If I have a URL like: ?param=AAÃ

On the receiving page a simple Request() call returns "AA" and not "AAÃ ".

It drops all accented characters!

If I change to use a Form instead, it works OK.

If I copy the Request.QueryString to a String variable and split it I
manage
to get the proper value.

I have tried this on Windows 2000 and Windows 2003 with the same result.

Is this a known bug with Request.QueryString? And if so is there a
fix/workaround??

Thanks

John Byrne
Australia


Jul 22 '05 #3


"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
This is an ASP Request object problem. Different browser makes no

difference.

Not necessarily.

Did you miss the part where I asked if the appears in a view-source? If
so, it's a browser problem. I'm not saying that this is the problem, but
it'd help to rule it out...

Ray at work
Jul 22 '05 #4
This is certainly a server-side issue. If the URL for a page is ?parm=AA*

and the ASP page did:

Response.Write(Request.QueryString);

you get:

parm=AA*

but if you did:

Response.Write(Request("parm"));

you get:

AA

but works fine if page invoke via a form (either post or get)

JB

"Ray Costanzo [MVP]" wrote:


"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
This is an ASP Request object problem. Different browser makes no

difference.

Not necessarily.

Did you miss the part where I asked if the à appears in a view-source? If
so, it's a browser problem. I'm not saying that this is the problem, but
it'd help to rule it out...

Ray at work

Jul 22 '05 #5
If you don't want answers, don't ask questions.

Ray at home

"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
This is certainly a server-side issue. If the URL for a page is ?parm=AA

and the ASP page did:

Response.Write(Request.QueryString);

you get:

parm=AA

but if you did:

Response.Write(Request("parm"));

you get:

AA

but works fine if page invoke via a form (either post or get)

JB

"Ray Costanzo [MVP]" wrote:


"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
> This is an ASP Request object problem. Different browser makes no

difference.

Not necessarily.

Did you miss the part where I asked if the à appears in a view-source?
If
so, it's a browser problem. I'm not saying that this is the problem, but
it'd help to rule it out...

Ray at work

Jul 22 '05 #6
Ray Costanzo [MVP] wrote on 20 dec 2004 in
microsoft.public.inetserver.asp.general:
If you don't want answers, don't ask questions.


I didn't ask, I still like to read the answers.

That is the joy of usenet.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 22 '05 #7
No, it's the people that are the joy of usenet. Also top-posting. ;]

Ray at home

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Ray Costanzo [MVP] wrote on 20 dec 2004 in
microsoft.public.inetserver.asp.general:
If you don't want answers, don't ask questions.


I didn't ask, I still like to read the answers.

That is the joy of usenet.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 22 '05 #8
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
"Ray Costanzo [MVP]" wrote:
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
This is an ASP Request object problem. Different browser makes no

difference.

Not necessarily.

Did you miss the part where I asked if the appears in a view-source? If so, it's a browser problem. I'm not saying that this is the problem, but it'd help to rule it out...

Ray at work

This is certainly a server-side issue. If the URL for a page is ?parm=AA

and the ASP page did:

Response.Write(Request.QueryString);

you get:

parm=AA

but if you did:

Response.Write(Request("parm"));

you get:

AA

but works fine if page invoke via a form (either post or get)

JB


Actually, it's probablly a combination of both client and server issues. I
believe the problem is associated with the character encoding. Here are some
things to check:

1. In your browser, what character encoding are you using?
2. On the server, what codepage/character encoding are being used. There are
quite a few places where codepage can be set. Here's an excerpt from the
Response.CodePage documentation that describes how the codepage setting
cascades:

If Response.CodePage is not explicitly set in a page, it is implicitly set
by Session.CodePage, if sessions are enabled. If sessions are not enabled,
Response.CodePage is set by @CodePage, if @CodePage is present in the page.
If there is no @CodePage in the page, Response.CodePage is set by the
AspCodePage metabase property. If the AspCodePage metabase property is not
set, or set to 0, Response.CodePage is set by the system ANSI codepage.

Here's a link to the documentation:
http://www.msdn.microsoft.com/librar...om_resopcp.asp

Jul 22 '05 #9
Thanks for your informative reply.

Initially the ASP pages had a charset of windows-1252 and the
Session.CodePage was 65001. I then went and changed all pages to use charset
UTF-8, but the problem still persisted.

I have also tried saving the ASP pages in UTF-8 format instead of the normal
ANSI encoding, but this also had no affect.

The work-around I had to come up with was create a function that would parse
the QueryString and return the requested parameter.

Thanks

"Chris Hohmann" wrote:
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
"Ray Costanzo [MVP]" wrote:
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...

> This is an ASP Request object problem. Different browser makes no
difference.

Not necessarily.

Did you miss the part where I asked if the à appears in a view-source? If so, it's a browser problem. I'm not saying that this is the problem, but it'd help to rule it out...

Ray at work

This is certainly a server-side issue. If the URL for a page is ?parm=AA*

and the ASP page did:

Response.Write(Request.QueryString);

you get:

parm=AA*

but if you did:

Response.Write(Request("parm"));

you get:

AA

but works fine if page invoke via a form (either post or get)

JB


Actually, it's probablly a combination of both client and server issues. I
believe the problem is associated with the character encoding. Here are some
things to check:

1. In your browser, what character encoding are you using?
2. On the server, what codepage/character encoding are being used. There are
quite a few places where codepage can be set. Here's an excerpt from the
Response.CodePage documentation that describes how the codepage setting
cascades:

If Response.CodePage is not explicitly set in a page, it is implicitly set
by Session.CodePage, if sessions are enabled. If sessions are not enabled,
Response.CodePage is set by @CodePage, if @CodePage is present in the page.
If there is no @CodePage in the page, Response.CodePage is set by the
AspCodePage metabase property. If the AspCodePage metabase property is not
set, or set to 0, Response.CodePage is set by the system ANSI codepage.

Here's a link to the documentation:
http://www.msdn.microsoft.com/librar...om_resopcp.asp

Jul 22 '05 #10

"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
"Chris Hohmann" wrote:
"John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
"Ray Costanzo [MVP]" wrote:
> "John Byrne" <Jo*******@discussions.microsoft.com> wrote in message
> news:D2**********************************@microsof t.com...
>
> > This is an ASP Request object problem. Different browser makes no
> difference.
>
> Not necessarily.
>
> Did you miss the part where I asked if the appears in a view-source?
If
> so, it's a browser problem. I'm not saying that this is the
problem, but
> it'd help to rule it out...
>
> Ray at work
>
This is certainly a server-side issue. If the URL for a page is
?parm=AA
and the ASP page did:

Response.Write(Request.QueryString);

you get:

parm=AA

but if you did:

Response.Write(Request("parm"));

you get:

AA

but works fine if page invoke via a form (either post or get)

JB
Actually, it's probablly a combination of both client and server issues.

I believe the problem is associated with the character encoding. Here are some things to check:

1. In your browser, what character encoding are you using?
2. On the server, what codepage/character encoding are being used. There are quite a few places where codepage can be set. Here's an excerpt from the
Response.CodePage documentation that describes how the codepage setting
cascades:

If Response.CodePage is not explicitly set in a page, it is implicitly set by Session.CodePage, if sessions are enabled. If sessions are not enabled, Response.CodePage is set by @CodePage, if @CodePage is present in the page. If there is no @CodePage in the page, Response.CodePage is set by the
AspCodePage metabase property. If the AspCodePage metabase property is not set, or set to 0, Response.CodePage is set by the system ANSI codepage.

Here's a link to the documentation:
http://www.msdn.microsoft.com/librar...om_resopcp.asp

Thanks for your informative reply.

Initially the ASP pages had a charset of windows-1252 and the
Session.CodePage was 65001. I then went and changed all pages to use

charset UTF-8, but the problem still persisted.

I have also tried saving the ASP pages in UTF-8 format instead of the normal ANSI encoding, but this also had no affect.

The work-around I had to come up with was create a function that would parse the QueryString and return the requested parameter.

Thanks


CodePage 65001 is associated with UTF-8, not Windows-1252. Here's a link to
the characterset/codepage table referenced in the Response.CodePage
documentation:
http://msdn.microsoft.com/workshop/a...s/charset4.asp
Also, did you check what the character encoding setting was in your browser?
Jul 22 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Fuzzyman | last post: by
2 posts views Thread by Remco van den Berg | last post: by
4 posts views Thread by gsuns82 | last post: by
1 post views Thread by gsauns | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.