473,587 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request object does not handle globalization?

Assume you have a simple HTML form that submits its form results to a .aspx
page. The receiving .aspx page processes the values sent by the form. If
the form data contains an accented character (ex., Ángel with an accent over
"A"), the REQUEST object appears to loose the globalization, and nukes any
extended ascii characters. Is there a way to avoid this? In the examples
below, the resulting string is "ngel", without the A and accent.
Suggestions?

string myKey = "Name";
string Test0 = Request.Form.Ge t(myKey);
string Test1 = Request[myKey];
string Test2 = Request[myKey].ToString(Cultu reInfo.CurrentC ulture);
string Test3 = Request[myKey].ToString(Cultu reInfo.Invarian tCulture);

In the web.config, all the defaults remain including:
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8" />

For those of you wondering why we do this, we have non-technical staff
members that create HTML forms. They all redirect to a .NET application
that handles the routing/logging in a consistent way. However, it appears
to be dropping all extended ascii characters. Neat.

Feb 6 '06 #1
1 1738
Hello Mark,

Welcome to the ASPNET newsgroup.

From your description, I understand you have some normal html pages which
will post some text data to some other ASP.NET web pages. The posted text
data contains some non-ascii chars and you found that those chars are not
handled correctly in the asp.net web pages, correct?

Based on my experience, this problem is likely caused by the html form text
data (sent to the asp.net page) is not encoded as utf-8 charset encoding.
For the ASP.NET web pages, since the web.config file has configured
request/response to use utf-8 encoding, if other charset/encoding text is
posted, the asp.net runtime will fail to correctly parse them.

What's the client machine's system locale setting, generally this will
affect the html page's text encoding because html or other text file is
saved as local machine's system locale's encoding(charse t). Also, I suggest
you save that test html page as "utf-8" through notepad or any other text
editor and retest it in browser to see whether it can correctly post those
non-asscii chars to asp.net page.

If there is anything unclear or if you have any other question, please feel
free to let me know.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 7 '06 #2

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

Similar topics

4
11577
by: Gerhard Pretorius | last post by:
ON Win 2003 IIS6, Since yesterday, (12 Aug 2003) for some strange reason, (after installing WindowsServer2003-KB823980-x86-ENU.exe) I cannot pass the Request object to to VB COM DLL. I have a funciton inVB DLL Function BuildSqlWhereFromHTML(ByRef AspReq As ASPTypeLibrary.Request, _ ByRef AspSes As ASPTypeLibrary.Session) As String
2
5027
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" />
8
5294
by: Ricky K. Rasmussen | last post by:
Hello NG, I'm having some encoding trouble using my own RequestHandler: Since the RequestHandler must be able to serve content with diffrent encoding, I set the Response.Charset and Response.ContentEncoding to the encoding of current content. Furthermore I set the Content-Type META tag of the html page to use the same charset as well. And this all works fine... I get my pages served and both the HTTP headers
5
2632
by: Filip | last post by:
Hello, (ASP.NET c#) I want to put some common functions into one class and within this class I need to have access to the Session, Request and Response. This class is not page behind file! I keep trying all sorts of namespaces, but to no avail. Keep getting: "The name 'Session' does not exist in the class or namespace 'xyz xyz xyz'" and "The type or namespace name 'Page' could not be found (are you missing a using directive or an...
3
2401
by: Axel Dahmen | last post by:
Hi, I've created an aspx page taking a query string argument as parameter. Although I've correctly escaped umlauts in the query string, they do not appear in the QueryString collection. If I give: http://myComp/myPage.aspx?q=G%FCnther Request.QueryString yields "Gnther" instead of "Günther". What's happening?
5
20062
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great with Firefox,but with IE6 the onFailure never gets called and the request never completes. My code: var ajaxReq = new Ajax.Request( url, {method: 'post', parameters:
2
2452
by: jp2express | last post by:
Does Request.QueryString need to be carried out using ASP, or can JavaScript handle this? I know it is simple, but I've never done it and I don't know what to search for. Say I wanted my default web page to display my projects. I want to be able to pass a link like this: www.joeswelding.biz/index.htm?page=projects
2
5504
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 that in if I do this: var state = <%=Request.QueryString%> This returns an undefined object that I can't seem to do any checks
2
1703
by: Water Cooler v2 | last post by:
Normally, in ASP.NET applications, we read from a Request object and write to the Response buffer. However, I wish to read the request object, do some validations on it, and route the request to a proxy server. How is routing a request to a proxy server achieved in ASP.NET?
0
7924
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
7978
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5722
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.