473,412 Members | 2,003 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,412 software developers and data experts.

Application Error Handler can not get current Unicode Url

I am using IIS 5.1 with ASP.NET 1.1
I cannot get the correct url in the error handler in the global.asax.
My testing global.asax:
<%@ Application %>
<script language="C#" runat="server">
public void Application_Error()
{
Server.ClearError();
Response.Write(Request.RawUrl + "<br>");
Response.Write(HttpUtility.UrlDecode("%e4%b8%80")) ;
}
</script>

I tried url http://localhost/%e4%b8%80.aspx
It's supposed to be "?" (a chinese character) in the url.
But I got /�.aspx in the Request.RawUrl.
I checked the IIS log and it logged the correct url in the log file.
Also HttpUtility.UrlDecode returns the correct url.

Thanks,
Steve


Nov 19 '05 #1
1 2600
It sounds like the page might have an invalid content type. Is the page
content type UTF-8 or UTF-16?

ASP.NET will pick up the content type from the page when doing its decoding.
In your case it looks like it's decoding the URL into a UTF8 string rather
than into a unicode string so you may have to 'double decode'. Try the UTF8
Encoder to decode the string you get back from UrlDecode.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog

"Steve" <st***@steve.com> wrote in message
news:nP****************@news20.bellglobal.com...
I am using IIS 5.1 with ASP.NET 1.1
I cannot get the correct url in the error handler in the global.asax.
My testing global.asax:
<%@ Application %>
<script language="C#" runat="server">
public void Application_Error()
{
Server.ClearError();
Response.Write(Request.RawUrl + "<br>");
Response.Write(HttpUtility.UrlDecode("%e4%b8%80")) ;
}
</script>

I tried url http://localhost/%e4%b8%80.aspx
It's supposed to be "?" (a chinese character) in the url.
But I got /�.aspx in the Request.RawUrl.
I checked the IIS log and it logged the correct url in the log file.
Also HttpUtility.UrlDecode returns the correct url.

Thanks,
Steve

Nov 19 '05 #2

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

Similar topics

2
by: Randy Harris | last post by:
I thought that I had a grasp of how VBA error handling functioned, but have just become painfully aware that I don't. I thought that the "On Error GoTo 0" in the second sub below would turn off...
6
by: Dmitry Karneyev | last post by:
Hi! I guess this question have been asked a lot of times, but please be tolerant and if you have any ideas share it. The question is: how to make availibale only one instance of application and...
2
by: Steph | last post by:
I am working on a Windows Forms App. I have attached a standard UnhandledExceptionEventHandler to the current domain to catch unexpected errors. In my application, when I trigger an unhandled...
5
by: Sonu | last post by:
Hello everyone and thanks in advance. I have a multilingual application which has been built in MFC VC++ 6.0 (non-Unicode). It support English German Hungarian so far, which has been fine. But...
6
by: jim | last post by:
Hi All, I like to know the life cycle of an ASP .NET Application( incudieng server application, such as .NET Web Service). That means from initialization to fully running and how to reboot it or...
9
by: DraguVaso | last post by:
Hi, I want my application to bring another application to the Front. I thought best way to do this was by the Process-model: Dim c As Process = Process.GetCurrentProcess() Dim p As Process...
2
by: Jukka Aho | last post by:
When converting Unicode strings to legacy character encodings, it is possible to register a custom error handler that will catch and process all code points that do not have a direct equivalent in...
2
by: Rares Vernica | last post by:
Hi, Does anyone know of any Unicode encode/decode error handler that does a better replace job than the default replace error handler? For example I have an iso-8859-1 string that has an 'e'...
23
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.