By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,676 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,676 IT Pros & Developers. It's quick & easy.

URLEncode Problem from ASP.NET

P: n/a
Hi All:
In my application I am sending the input values through query string from a datagrid template column,I used URLEncode to encode the URL String,
please find the input below, I am facing a problem when the input string contains « character ,
Here from ASP.NET I am redirecting to the ASP based system,when I give same input from ASP based system, it is showing Microsoft%AE%20Access%20 ,with this I am getting the correct results, where as when I send it from the ASP.NET with URL Encode it is showing Microsoft%c2%ae+Access, this is not giving any results. Can any one please help me out what to do to get the URL string simillar to I got it in ASP. Is there any different way to handle the encoding when « character present in the string.


Input:
Microsoft« Access
My Code:
<asp:TemplateColumn HeaderText="Sample Column">
<ItemTemplate>
<asp:Hyperlink runat="server" Text='<%#(string)DataBinder.Eval(Container.DataIte m,"ProductName")%>' NavigateUrl='<%# "http://trwork/SMSReporting_TRS/Report.asp?ReportID=67&amp;variable="+Server.UrlEn code((string)DataBinder.Eval(Container.DataItem,"P roductName"))%>' ID="Hyperlink1"/>
</ItemTemplate>
</asp:TemplateColumn>

From ASP URL String :
http://trwork/SMSReporting_TRS/Repor...AE%20Access%20

From ASP.NET URL String:
http://trwork/SMSReporting_TRS/Repor...t%c2%ae+Access

Thanks in Advance


Nov 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"vtreddy" <vt*****@hotmail.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl...
Hi All:
In my application I am sending the input values through query string from a datagrid template column,I used URLEncode to
encode the URL String, please find the input below, I am facing a problem when the input string contains « character , Here from ASP.NET I am redirecting to the ASP based system,when I give same input from ASP based system, it is showing
Microsoft%AE%20Access%20 ,with this I am getting the correct results, where as when I send it from the ASP.NET with URL Encode it is showing Microsoft%c2%ae+Access, this is not giving any results. Can any one please help me out what to do to get the URL string simillar to I got it in ASP. Is there any different way to handle the encoding when « character present in the string.


%C2%AE is the UTF-8 encoding for the (R) character. Your ASP page was
probably using CodePage="1252" or something like that, which is a Latin 1
codepage. The (R) character is %AE in that codepage.

To get your ASP.NET page to behave the same way, try setting
Response.Charset and Response.ContentEncoding:

Response.Charset = "iso-8859-1"; // Latin 1
Response.ContentEncoding = System.Text.GetEncoding(Response.Charset);

Another way to fix this is to change the Report.asp page so that it
understands Unicode. This will allow your application to use characters from
more than just the Latin 1 character set. I think you can do this by setting
CodePage="65001" on your Report.asp page but I'm not sure.

Nov 17 '05 #2

P: n/a
Bret,

Thank you very much for your help, Session.CodePage = 65001 is commented out in asp based reporting system, when I uncommented the code,It worked fine.

Best Regards,

Thirupathi
"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message news:gqomb.22025$Fm2.11405@attbi_s04...
"vtreddy" <vt*****@hotmail.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl...
Hi All:
In my application I am sending the input values through query string from

a datagrid
template column,I used URLEncode to
encode the URL String, please find the input below, I am facing a problem

when the input
string contains « character , Here from ASP.NET I am redirecting to the

ASP based
system,when I give same input from ASP based system, it is showing
Microsoft%AE%20Access%20 ,with this I am getting the correct results,

where as when I
send it from the ASP.NET with URL Encode it is showing

Microsoft%c2%ae+Access,
this is not giving any results. Can any one please help me out what to do

to get the URL
string simillar to I got it in ASP. Is there any different way to handle

the encoding when «
character present in the string.


%C2%AE is the UTF-8 encoding for the (R) character. Your ASP page was
probably using CodePage="1252" or something like that, which is a Latin 1
codepage. The (R) character is %AE in that codepage.

To get your ASP.NET page to behave the same way, try setting
Response.Charset and Response.ContentEncoding:

Response.Charset = "iso-8859-1"; // Latin 1
Response.ContentEncoding = System.Text.GetEncoding(Response.Charset);

Another way to fix this is to change the Report.asp page so that it
understands Unicode. This will allow your application to use characters from
more than just the Latin 1 character set. I think you can do this by setting
CodePage="65001" on your Report.asp page but I'm not sure.


Nov 17 '05 #3

P: n/a
Bret,

When I Set the CodePage="65001", I am getting the results,the Query string is decoded properly, please find below the output, but in the result,it is adding ┬ character before « character,Could you please let me know, How to encode the string to avoid ┬ here.

Parameters: Microsoft« Access
Computer Name User Name Product Name Company Name Product Version
TRWORK Administrator Microsoft® Access Microsoft Corporation 3.00.0002

Thank you very much for your help.

Thirupathi

"vtreddy" <vt*****@hotmail.com> wrote in message news:eY*************@TK2MSFTNGP09.phx.gbl...
Bret,

Thank you very much for your help, Session.CodePage = 65001 is commented out in asp based reporting system, when I uncommented the code,It worked fine.

Best Regards,

Thirupathi
"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message news:gqomb.22025$Fm2.11405@attbi_s04...
"vtreddy" <vt*****@hotmail.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl...
Hi All:
In my application I am sending the input values through query string from

a datagrid
template column,I used URLEncode to
encode the URL String, please find the input below, I am facing a problem

when the input
string contains « character , Here from ASP.NET I am redirecting to the

ASP based
system,when I give same input from ASP based system, it is showing
Microsoft%AE%20Access%20 ,with this I am getting the correct results,

where as when I
send it from the ASP.NET with URL Encode it is showing

Microsoft%c2%ae+Access,
this is not giving any results. Can any one please help me out what to do

to get the URL
string simillar to I got it in ASP. Is there any different way to handle

the encoding when «
character present in the string.


%C2%AE is the UTF-8 encoding for the (R) character. Your ASP page was
probably using CodePage="1252" or something like that, which is a Latin 1
codepage. The (R) character is %AE in that codepage.

To get your ASP.NET page to behave the same way, try setting
Response.Charset and Response.ContentEncoding:

Response.Charset = "iso-8859-1"; // Latin 1
Response.ContentEncoding = System.Text.GetEncoding(Response.Charset);

Another way to fix this is to change the Report.asp page so that it
understands Unicode. This will allow your application to use characters from
more than just the Latin 1 character set. I think you can do this by setting
CodePage="65001" on your Report.asp page but I'm not sure.


Nov 17 '05 #4

P: n/a
It's possible that the ASP page is interpreting the string correctly now and
is rendering the page using UTF-8, but the browser is not interpreting the
page as UTF-8. If you're using IE, check to see what "View / Encoding" says
the page is set to. If it's not Unicode, check to see if the page has a
<meta name="content-type" content="text/html; charset=utf-8" /> tag. If it
includes this tag but shows iso-8859-1 or some other charset value, try
changing it to utf-8. You can play with different values of View / Encoding
in the browser to determine which encoding the server actually used for the
page output.
"vtreddy" <vt*****@hotmail.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
Bret,
When I Set the CodePage="65001", I am getting the results,the Query string
is decoded properly, please find below the output, but in the result,it is
adding ┬ character before « character,Could you please let me know, How to
encode the string to avoid ┬ here.
Parameters: Microsoft« Access
Computer Name User Name Product Name Company Name Product Version
TRWORK Administrator Microsoft® Access Microsoft Corporation
3.00.0002
Thank you very much for your help.
Thirupathi
"vtreddy" <vt*****@hotmail.com> wrote in message
news:eY*************@TK2MSFTNGP09.phx.gbl...
Bret,

Thank you very much for your help, Session.CodePage = 65001 is commented out
in asp based reporting system, when I uncommented the code,It worked fine.

Best Regards,

Thirupathi
"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message
news:gqomb.22025$Fm2.11405@attbi_s04...
"vtreddy" <vt*****@hotmail.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl...
Hi All:
In my application I am sending the input values through query string
from a datagrid
template column,I used URLEncode to
encode the URL String, please find the input below, I am facing a
problem when the input
string contains « character , Here from ASP.NET I am redirecting to the ASP based
system,when I give same input from ASP based system, it is showing
Microsoft%AE%20Access%20 ,with this I am getting the correct results,

where as when I
send it from the ASP.NET with URL Encode it is showing

Microsoft%c2%ae+Access,
this is not giving any results. Can any one please help me out what to

do to get the URL
string simillar to I got it in ASP. Is there any different way to handle the encoding when «
character present in the string.


%C2%AE is the UTF-8 encoding for the (R) character. Your ASP page was
probably using CodePage="1252" or something like that, which is a Latin 1
codepage. The (R) character is %AE in that codepage.

To get your ASP.NET page to behave the same way, try setting
Response.Charset and Response.ContentEncoding:

Response.Charset = "iso-8859-1"; // Latin 1
Response.ContentEncoding = System.Text.GetEncoding(Response.Charset);

Another way to fix this is to change the Report.asp page so that it
understands Unicode. This will allow your application to use characters

from more than just the Latin 1 character set. I think you can do this by setting CodePage="65001" on your Report.asp page but I'm not sure.

Nov 17 '05 #5

P: n/a
Bret,
I changed to utf-8, it is displaying the results correctly,
Thank you very much for your help,
Best Regards,
Thirupathi
"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message
news:VABmb.13219$mZ5.76921@attbi_s54...
It's possible that the ASP page is interpreting the string correctly now and is rendering the page using UTF-8, but the browser is not interpreting the
page as UTF-8. If you're using IE, check to see what "View / Encoding" says the page is set to. If it's not Unicode, check to see if the page has a
<meta name="content-type" content="text/html; charset=utf-8" /> tag. If it includes this tag but shows iso-8859-1 or some other charset value, try
changing it to utf-8. You can play with different values of View / Encoding in the browser to determine which encoding the server actually used for the page output.
"vtreddy" <vt*****@hotmail.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
Bret,
When I Set the CodePage="65001", I am getting the results,the Query string is decoded properly, please find below the output, but in the result,it is
adding ┬ character before « character,Could you please let me know, How to
encode the string to avoid ┬ here.
Parameters: Microsoft« Access
Computer Name User Name Product Name Company Name Product Version TRWORK Administrator Microsoft® Access Microsoft Corporation
3.00.0002
Thank you very much for your help.
Thirupathi
"vtreddy" <vt*****@hotmail.com> wrote in message
news:eY*************@TK2MSFTNGP09.phx.gbl...
Bret,

Thank you very much for your help, Session.CodePage = 65001 is commented out in asp based reporting system, when I uncommented the code,It worked fine.

Best Regards,

Thirupathi
"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message
news:gqomb.22025$Fm2.11405@attbi_s04...
"vtreddy" <vt*****@hotmail.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl...
Hi All:
In my application I am sending the input values through query string from
a datagrid
template column,I used URLEncode to
encode the URL String, please find the input below, I am facing a

problem
when the input
string contains « character , Here from ASP.NET I am redirecting to

the ASP based
system,when I give same input from ASP based system, it is showing
Microsoft%AE%20Access%20 ,with this I am getting the correct results,

where as when I
send it from the ASP.NET with URL Encode it is showing

Microsoft%c2%ae+Access,
this is not giving any results. Can any one please help me out what to do
to get the URL
string simillar to I got it in ASP. Is there any different way to

handle the encoding when «
character present in the string.


%C2%AE is the UTF-8 encoding for the (R) character. Your ASP page was
probably using CodePage="1252" or something like that, which is a Latin 1 codepage. The (R) character is %AE in that codepage.

To get your ASP.NET page to behave the same way, try setting
Response.Charset and Response.ContentEncoding:

Response.Charset = "iso-8859-1"; // Latin 1
Response.ContentEncoding = System.Text.GetEncoding(Response.Charset);

Another way to fix this is to change the Report.asp page so that it
understands Unicode. This will allow your application to use characters

from
more than just the Latin 1 character set. I think you can do this by

setting
CodePage="65001" on your Report.asp page but I'm not sure.


Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.