Re: WO 5.4 form value encoding problem
Re: WO 5.4 form value encoding problem
- Subject: Re: WO 5.4 form value encoding problem
- From: Steve Quirk <email@hidden>
- Date: Tue, 24 Jun 2008 13:57:39 -0400 (EDT)
On Tue, 24 Jun 2008, Alan Ward wrote:
On Jun 24, 2008, at 10:56 AM, Kenny Leung wrote:
I've figured it out - you have to stick in a meta tag to force the browser
to use UTF-8. Something like.
<html>
<head>
<meta charset="UTF-8"></meta>
</head>
<body>
Some stuff...
</body>
</html>
No, that tells the browser what encoding the page is in. Forms have an
"accept-encoding" tag which
tells the browser how to encode the user input that it's going to post.
Note that I simply cannot get it to work with ISO8859_1 encoding.
That's probably because you're not doing it right ;-)
And doing it right is pretty easy - just follow the spec:
http://www.w3.org/TR/html401/interact/forms.html#adef-accept-charset
accept-charset = charset list [CI]
This attribute specifies the list of character encodings for input data
that is accepted by the server processing this form. The value is a space-
and/or comma-delimited list of charset values. The client must interpret
this list as an exclusive-or list, i.e., the server is able to accept any
single character encoding per entity received.
The default value for this attribute is the reserved string "UNKNOWN".
User agents may interpret this value as the character encoding that was
used to transmit the document containing this FORM element.
Charset problems can be a real pain, especially when dealing with legacy
databases. It really does pay to know enough about the specs to look up
the right way when you're confronted with a problem.
Steve
Alan
-Kenny
On Jun 23, 2008, at 10:16 AM, Kenny Leung wrote:
Hi All.
I've bumped into an incompatibility between WebObjects 5.3 and 5.4. In
5.3, I could submit a form value with non-ASCII characters, and their
encoding would be correctly interpreted. In 5.4, the encoding is
misinterpreted.
I printed out the actual request contents, and, for instance e-acute is
sent as é, which as far as I know is correct ISO8859 encoding. I read in
the release notes that WO 5.4 now defaults to UTF8 encoding, so I tried to
change the request's defaultFormValueEncoding to ISO8859_1. Then it got
interpreted as a literal é!
Can anybody shed some light on this? I have searched the lists and the
Google, and have come up empty.
Thanks!
-Kenny
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden