Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Querystring with accented characters
I have encountered a problem when certain European characters are included i
n
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

Report this thread to moderator Post Follow-up to this message
Old Post
John Byrne
12-17-04 08:55 AM


Re: Querystring with accented characters
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" <JohnByrne@discussions.microsoft.com> wrote in message
news:1F0C8AF5-6C7C-4F8B-B426-C9962EDBF0A2@microsoft.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



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
12-17-04 08:55 AM


Re: Querystring with accented characters
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" <JohnByrne@discussions.microsoft.com> wrote in message
> news:1F0C8AF5-6C7C-4F8B-B426-C9962EDBF0A2@microsoft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
John Byrne
12-17-04 08:55 AM


Re: Querystring with accented characters

"John Byrne" <JohnByrne@discussions.microsoft.com> wrote in message
news:D27E2B2F-4520-46BD-B92A-22F0B40D469A@microsoft.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



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
12-17-04 08:55 PM


Re: Querystring with accented characters
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" <JohnByrne@discussions.microsoft.com> wrote in message
> news:D27E2B2F-4520-46BD-B92A-22F0B40D469A@microsoft.com...
> 
> difference.
>
> Not necessarily.
>
> Did you miss the part where I asked if the ƃ appears in a view-source?  I
f
> 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
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
John Byrne
12-20-04 08:55 AM


Re: Querystring with accented characters
If you don't want answers, don't ask questions.

Ray at home

"John Byrne" <JohnByrne@discussions.microsoft.com> wrote in message
news:14BA46D0-5D81-4925-BBA1-D661DEB40847@microsoft.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:
> 



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
12-20-04 08:55 AM


Re: Querystring with accented characters
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)

Report this thread to moderator Post Follow-up to this message
Old Post
Evertjan.
12-20-04 01:55 PM


Re: Querystring with accented characters
No, it's the people that are the joy of usenet.  Also top-posting.  ;]

Ray at home

"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns95C559C356EABeejj99@194.109.133.29...
> Ray Costanzo [MVP] wrote on 20 dec 2004 in
> microsoft.public.inetserver.asp.general: 
>
> 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)



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
12-20-04 08:55 PM


Re: Querystring with accented characters
"John Byrne" <JohnByrne@discussions.microsoft.com> wrote in message
news:14BA46D0-5D81-4925-BBA1-D661DEB40847@microsoft.com...
> "Ray Costanzo [MVP]" wrote: 
If 
but 
> 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/libra...bom_resopcp.asp




Report this thread to moderator Post Follow-up to this message
Old Post
Chris Hohmann
12-21-04 01:55 AM


Re: Querystring with accented characters
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" <JohnByrne@discussions.microsoft.com> wrote in message
> news:14BA46D0-5D81-4925-BBA1-D661DEB40847@microsoft.com... 
> If 
> but 
>
> Actually, it's probablly a combination of both client and server issues. I
> believe the problem is associated with the character encoding. Here are so
me
> 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 a
re
> 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:
> [url]http://www.msdn.microsoft.com/library/en-us/iissdk/iis/ref_vbom_resopcp.asp[/url
]
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
John Byrne
12-21-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:44 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.