473,569 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wrong encoding reading form fields

Hi,

im using a form to get some input from the user. This form is in a
HTML file.

When I post the form directly to my email, i receive all fields
correctly. Example test.html:
<FORM action="MAILTO: my*****@work.co m" method=post
enctype="text/plain">

But if I post the form to an aspx page and try to read the fields
value, i get the wrong encoding content. Example

test.html:
<FORM action="test.as px" method=post>

test.aspx
for(int i=0 ; i<Request.Form. Count; i++)
Response.Write( Request.Form.Ke ys[i]+"="+Request.Fo rm[i]);

This will print all fields and values, but without any portuguese
characters.

So, anyone knows were i must define the encoding to solve this
problem? ive tried putting in metatag in test.html page, tried putting
in page directive in test.aspx page. Nothing works.

Wich encoding is responsible form Request.Form values?
Thanks,
Nelson R.
Nov 19 '05 #1
3 2104

"Nelson R." <n [th0t] russa [at] ebase [th0t] pt> wrote in message
news:dn******** *************** *********@4ax.c om...
for(int i=0 ; i<Request.Form. Count; i++)
Response.Write( Request.Form.Ke ys[i]+"="+Request.Fo rm[i]);

This will print all fields and values, but without any portuguese
characters.


Hi!

I have had a similar problem with danish characters. I solved the problem by
using the HtmlEncode method.
You only have to encode the strings you send to the server (your aspx page)
and the server will automaticly decode the string.

If you look the HtmlEcode method up in the documentation I am certain, that
you will find a solution to your problem.

Best regards
Torben
Nov 19 '05 #2
Hi Torben,
thanks for your response.

I understand the use of Server.HtmlEnco de when encoding an URL
parameters.
But in my situation, I have an HTML page with a form posting to an
ASPX page. I can only use server code when reading form fields in ASPX
page.

When posting directly to an email, the characters are correct, but
when posting to an ASPX page all portuguese chars are gone... so I
supose the problem is in the ASPX page, that should be using the
correct encoding for reading posted form fields...

Any ideas?

Nelson R.


On Thu, 6 Jan 2005 20:00:03 +0100, "Torben Philippsen" <no@mail.dk>
wrote:

"Nelson R." <n [th0t] russa [at] ebase [th0t] pt> wrote in message
news:dn******* *************** **********@4ax. com...
for(int i=0 ; i<Request.Form. Count; i++)
Response.Write( Request.Form.Ke ys[i]+"="+Request.Fo rm[i]);

This will print all fields and values, but without any portuguese
characters.


Hi!

I have had a similar problem with danish characters. I solved the problem by
using the HtmlEncode method.
You only have to encode the strings you send to the server (your aspx page)
and the server will automaticly decode the string.

If you look the HtmlEcode method up in the documentation I am certain, that
you will find a solution to your problem.

Best regards
Torben


Nov 19 '05 #3
Hi,

solved my problem. Needed to change encoding in webconfig to:

<globalizatio n requestEncoding ="windows-1252"
responseEncodin g="windows-1252" />
Now its working.
Nelson R.

On Fri, 07 Jan 2005 09:46:34 +0000, Nelson R. <n [th0t] russa [at]
ebase [th0t] pt> wrote:
Hi Torben,
thanks for your response.

I understand the use of Server.HtmlEnco de when encoding an URL
parameters.
But in my situation, I have an HTML page with a form posting to an
ASPX page. I can only use server code when reading form fields in ASPX
page.

When posting directly to an email, the characters are correct, but
when posting to an ASPX page all portuguese chars are gone... so I
supose the problem is in the ASPX page, that should be using the
correct encoding for reading posted form fields...

Any ideas?

Nelson R.


On Thu, 6 Jan 2005 20:00:03 +0100, "Torben Philippsen" <no@mail.dk>
wrote:

"Nelson R." <n [th0t] russa [at] ebase [th0t] pt> wrote in message
news:dn****** *************** ***********@4ax .com...
for(int i=0 ; i<Request.Form. Count; i++)
Response.Write( Request.Form.Ke ys[i]+"="+Request.Fo rm[i]);

This will print all fields and values, but without any portuguese
characters.


Hi!

I have had a similar problem with danish characters. I solved the problem by
using the HtmlEncode method.
You only have to encode the strings you send to the server (your aspx page)
and the server will automaticly decode the string.

If you look the HtmlEcode method up in the documentation I am certain, that
you will find a solution to your problem.

Best regards
Torben


Nov 19 '05 #4

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

Similar topics

1
6006
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that required fields in a form have values. I'm writing the values to the client using document.write only so that I can confirm that the values are there to...
3
1520
by: Alan Pocklington | last post by:
Hi, I've created a Java Applet that allows the user to select a record. As the user makes the selection, the applet uses LiveConnect (JSObject) to write the record id to a html field (the name of which is passed in to the applet as an arg). This all works fine, but now I have two instances of the same applet running on a page, both...
2
6890
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In this example, the MessageID element should always occur (minOccur=1, maxOccur=1), but the WSDL generates minOccur=0. I can't pinpoint why this is...
2
6681
by: joakim.hove | last post by:
Hello, I am having great problems writing norwegian characters æøå to file from a python application. My (simplified) scenario is as follows: 1. I have a web form where the user can enter his name. 2. I use the cgi module module to get to the input from the user: .... name = form.value
19
3316
by: Thomas W | last post by:
I'm getting really annoyed with python in regards to unicode/ascii-encoding problems. The string below is the encoding of the norwegian word "fødselsdag". I stored the string as "fødselsdag" but somewhere in my code it got translated into the mess above and I cannot get the original string back. It cannot be printed in the console or...
3
5479
by: mortb | last post by:
1. How do I determine which encoding a xmldocument or xmlreader uses when opening a document? I'm not just talking about the <?xml encoding="utf-8"?attribute, but the actual encoding of the characters in the underlying stream. 2. How do I make sure that the encoding of my created xmldocument or xmlwriter is in utf-8? Thanks! /mortb
8
2671
by: Erwin Moller | last post by:
Hi group, I could use a bit of guidance on the following matter. I am starting a new project now and must make some decisions regarding encoding. Environment: PHP4.3, Postgres7.4.3 I must be able to receive forminformation and store that in a database and later produce it on screen on the client (just plain HTML).
1
6827
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send mail externally to a internet email site like Gmail the PDF is sent but is corrupted because CDOSYS ends up using binary encoding rather than Base64...
16
4509
by: raylopez99 | last post by:
I am running out of printing paper trying to debug this...it has to be trivial, but I cannot figure it out--can you? Why am I not printing text, but just the initial string "howdy"? On the screen, when I open a file, the entire contents of the file is in fact being shown...so why can't I print it later? All of this code I am getting from...
0
7612
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...
0
8120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
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...
0
7968
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...
1
5512
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...
0
5219
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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
0
937
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...

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.