wrong encoding

H

Hans Meier

When I submit a form, Internet Explorer 6 encodes the form data á to %C3%A0
in
the URL. It should be %E1. What's wrong?

%C3%A0 seams to be the Unicode character of á, but á is also in the ANSI
character set (%E1).
 
B

Bertilo Wennergren

Hans Meier:
When I submit a form, Internet Explorer 6 encodes the form data á to %C3%A0
in the URL. It should be %E1. What's wrong?
%C3%A0 seams to be the Unicode character of á, but á is also in the ANSI
character set (%E1).

It does indeed seem to be the Unicode, UTF-8, way to encode "á". If the
page itself is in UTF-8, and correctly announced as UTF-8, then the
browser will (and probably should) send the data as UTF-8.

But Explorer can be set to always use UTF-8 when sending form data (or
URLs in general). Look around in your browser settings. May that is the
problem.
 
H

Hans Meier

Changing the browser settings is not an acceptable solution.
But maybe I can change the character set of the page using HTML tags.
Do you know how to do that?
 
J

Jukka K. Korpela

Hans Meier said:
Changing the browser settings is not an acceptable solution.
But maybe I can change the character set of the page using HTML tags.
Do you know how to do that?

It seems that you don't know the basics of using character encodings on the
Web (since you regard it primarily as an HTML issue), or even the basics of
netiquette (since you use TOFU, Text Oben Fullquote Unten). I would
recommend gaining basic understanding of such issues, see e.g.
http://www.cs.tut.fi/~jkorpela/html/chars.html
and then attacking the hard problem of character encodings for form data,
see http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html
 
B

Bertilo Wennergren

Hans Meier:
Changing the browser settings is not an acceptable solution.

In this case you might have to.
But maybe I can change the character set of the page using HTML tags.
Do you know how to do that?

You should make the server announce the character encoding. It does that
in the HTTP header that it sends to the browser _before it sends the
actual page_.

But in order to do that you either need to be able to configure the
server yourself, of have the server administrator do it for you (or use
PHP or something similar, where you can handle these things).

If you really can't have the server do it correctly, you can as a last
resort put the information in a "meta" element in the HTML code. That's
a surrogate solution, but it usually works.

In that case the code is this (it goes somewhere in the "head" section):

<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">

Or, if you use XHTML, this:

<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />

That's for announcing Latin 1, the most commonly used encoding. If you
do want to use Unicode instead, replace "iso-8859-1" with "UTF-8".

But if the server also sends info about the encoding, and says something
else than your "meta" element, then you have a problem. The browsers
should obey what the server says, but many of them obey the "meta"
element instead. And some just get very confused (sometimes). So do try
to do it the right way: in the server.

Actually, if you use XHTML, and if you want to use Latin 1, then you
_must_ announce the encoding in the HTTP header (the server way), or
else add some more funny code in the HTML (that might cause other problems).

But, if Explorer is set to always use UTF-8 in URLs, this might not do
the trick for you.

It is a complicated issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top