Hello,
I am experiencing a weird behaviour on my ASP.NET project. The project
consists from client-side, which can be whatever environment - web page, EXE
application, etc. The client sends HTTP POST request to the server with
data, and the server has ASP.NET application that handles the request and
gives answer.
I have biled all the fat code down to a very simple test case, which
consists from three files - HTML page, which does runtime HTTP POST request
(available in IExplorer from JS5, and all versions of Mozilla), and calls
two supposed-to-be-identical scripts, one done in classic ASP, another in
ASP.NET. The latter seems to lose all the characters 0xE4 in the incoming
POST data.
Please see the demo code here: http://www.s3.lv/demo/msnews.lostcharacter ,
you can also download the source code there.
I am now considering to do some mumbo-jumbo to handle the "%e4" characters
in some other way, what is hassle af course, because it involves both client
and server side code adjustments. It would be nice to understand, why this
is happening.
Regards,
Pavils 6 2502
Pavils Jurjans wrote: Hello,
I am experiencing a weird behaviour on my ASP.NET project. The project consists from client-side, which can be whatever environment - web page, EXE application, etc. The client sends HTTP POST request to the server with data, and the server has ASP.NET application that handles the request and gives answer.
I have biled all the fat code down to a very simple test case, which consists from three files - HTML page, which does runtime HTTP POST request (available in IExplorer from JS5, and all versions of Mozilla), and calls two supposed-to-be-identical scripts, one done in classic ASP, another in ASP.NET. The latter seems to lose all the characters 0xE4 in the incoming POST data.
First of all, what is 0xE4 supposed to be? A Unicode code point? A
character from an 8 bit character encoding?
Please see the demo code here: http://www.s3.lv/demo/msnews.lostcharacter , you can also download the source code there.
I am now considering to do some mumbo-jumbo to handle the "%e4" characters in some other way, what is hassle af course, because it involves both client and server side code adjustments. It would be nice to understand, why this is happening.
Your test code claims to post UTF-8, but 0xE4 is not a valid byte
sequence in UTF-8. Thus, the ASP.NET UTF-8 decoder stops after "a=X". I
guess the reason why it works in ASP is that the ASP runtime ignores
the charset attribute and uses some default character encoding like
ISO-8859-1 or Windows-1252 for which 0xE4 is a valid character.
Cheers,
-- http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Hi Joerg,
"Joerg Jooss" <ne********@joe rgjooss.de> wrote in message
news:xn******** ********@msnews .microsoft.com. .. First of all, what is 0xE4 supposed to be? A Unicode code point? A character from an 8 bit character encoding?
It's a character code for an Estonian character.
Your test code claims to post UTF-8, but 0xE4 is not a valid byte sequence in UTF-8. Thus, the ASP.NET UTF-8 decoder stops after "a=X". I guess the reason why it works in ASP is that the ASP runtime ignores the charset attribute and uses some default character encoding like ISO-8859-1 or Windows-1252 for which 0xE4 is a valid character.
This really shouldn't matter, because the sequence is URL-encoded anyway.
Pavils
Pavils Jurjans wrote: Hi Joerg,
"Joerg Jooss" <ne********@joe rgjooss.de> wrote in message news:xn******** ********@msnews .microsoft.com. ..
First of all, what is 0xE4 supposed to be? A Unicode code point? A character from an 8 bit character encoding?
It's a character code for an Estonian character.
In what encoding? In Unicode, this character is "ä". Your test code claims to post UTF-8, but 0xE4 is not a valid byte sequence in UTF-8. Thus, the ASP.NET UTF-8 decoder stops after "a=X". I guess the reason why it works in ASP is that the ASP runtime ignores the charset attribute and uses some default character encoding like ISO-8859-1 or Windows-1252 for which 0xE4 is a valid character.
This really shouldn't matter, because the sequence is URL-encoded anyway.
It does matter. URL encoding is a means to transport special characters
(or rather their code points) in URLs using safe character sequences.
Sender and receiver need to agree on how to map those sequences to the
real characters. There's no implict or default character encoding when
using URL encoding.
If "ä" is the character you want to use, try %C3%A4 instead -- that's
the proper way to URL encode it based on UTF-8.
Cheers,
-- http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Hi
I once experienced problems with my website losing my £ pound sign on
postback.
"Pavils Jurjans" <pa****@mailbox .riga.lv> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Hello,
I am experiencing a weird behaviour on my ASP.NET project. The project consists from client-side, which can be whatever environment - web page, EXE application, etc. The client sends HTTP POST request to the server with data, and the server has ASP.NET application that handles the request and gives answer.
I have biled all the fat code down to a very simple test case, which consists from three files - HTML page, which does runtime HTTP POST request (available in IExplorer from JS5, and all versions of Mozilla), and calls two supposed-to-be-identical scripts, one done in classic ASP, another in ASP.NET. The latter seems to lose all the characters 0xE4 in the incoming POST data.
Please see the demo code here: http://www.s3.lv/demo/msnews.lostcharacter , you can also download the source code there.
I am now considering to do some mumbo-jumbo to handle the "%e4" characters in some other way, what is hassle af course, because it involves both client and server side code adjustments. It would be nice to understand, why this is happening.
Regards,
Pavils
Hi Joerg, It does matter. URL encoding is a means to transport special characters (or rather their code points) in URLs using safe character sequences. Sender and receiver need to agree on how to map those sequences to the real characters. There's no implict or default character encoding when using URL encoding.
It nice to see a person here who knows the talk about encodings and their
application in transfers, its a true rarity.
I was somewhat blinded by assumption, that the only thing the server does is
decodes URL-encoded content, and creates string from the aquired charcodes
right away. Of course, there comes the character conversion in the middle! I
checked a code that I wrote for classic ASP two years ago, that was doing
just that - since the classic ASP did not intercept any character encoding
information for the incoming POST data (nor the browser is obliged to send a
hint), I made a code that reads the Request.BinaryR ead(), splits the
received content by "=" and "&" characters, URL-decodes every key-value
pair, and finally applies the character encoding provided in the function
parameter, to get the correct unicode string.
I decided to solve my %e4 problem by committing to the server a direct code
point information:
var dataBody = "a=%u00e4";
This works on both classic ASP and ASP.NET, and I need not to bother about
the applied character encodings.
Thanks for opening my eyes,
Pavils This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Bartosz Wegrzyn |
last post by:
Hi,
I have simple web with authentication.
My main page looks like this:
<?php
include ("nav.htm");
include ("auth.php");
$menu = $_GET;
|
by: dmcconkey |
last post by:
Hi folks,
I have a client with four websites. Each site has a contact form that
is identical. They all have "required" fields validated through a
JavaScript onSubmit() function. Upon validation, post values go to a
PHP processing page that adds values to a database and generates an
email to someone in marketing.
For three of these sites, we have no problem, but the fourth keeps
sending in blank forms.
|
by: SteveS |
last post by:
Hello, this problem is driving me nuts! I am using the Content Ratings
(RSACi) for my website. The settings strictly "G" rated - No violence, sex,
nudity or offensive language. I have a user who also has his "Content
Advisor" turned on. For some reason, the session is lost for the user
ONLY after he runs a javascript function on the page, then clicks submit.
Make sense? If he clicks submit without first running any javascript ,...
|
by: CCP |
last post by:
I've got a simple HTML page containing a form and a few hidden
variables.
This form post into a .Net application (that lives in a seperate
directory).
The first thing I do in my codebehind is grab the values of the form
fields, however .net is unable to see these values. The entire
Request.Form object is empty. Request.Form.Count == 0. If I turn on
the tracing/debug output the form itself isn't even listed.
|
by: bdobby |
last post by:
Hi.
I am relatively new to js, but I did think I was starting to get the
hang of it. Then this happened...
I have a form with an onsubmit event handler:
<form id="uploadForm" method="post" action="..."
onSubmit="checkDates()">
The event handler does some minor validation, then returns true or
| |
by: amer.terzic |
last post by:
Here's what my code is supposed to do (it seems to work fine)
Take a char* array and remove a first character from it....as simple as
that.
The mentioned char* array is a 'global' var shared among threads.
Declared as : char* buffer = (char*) malloc(bufferSize)
(later I changed it to use C++ 'new', but it does the same thing)
|
by: Vic Spainhower |
last post by:
Hello,
I have an HTML table that is being constructed from a MySQL table and
displays a form that includes a check box on 1 of the fields on the form for
each record. I have included in this PHP program a javascript routine called
sorttable.js which is something I found on the internet for sorting tables
and works quite well. The HTML table includes a check box on each record so
the user can select certain records for passing to the...
|
by: vikas251074 |
last post by:
I am using Oracle 9i and ASP
I have empno, empname, designation, category, dob.
Category have two option 'S' or 'O'
When I enter empno, empname, designation, category and dob
and when I press enter key all the data remains on the form but only list value is lost. what should I do ? How can I solve this.
<%@ Language=VBScript%>
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |