On 10/24/06, Ian Bicking <[EMAIL PROTECTED]> wrote: > Shannon -jj Behrens wrote: > >> I haven't done much testing around this, so I don't know. This could > >> potentially be done with a wrapper around MultiDict too, that lazily > >> decodes the values. > > > > This can be a frustrating subject. Did you know if you set > > accept-encodings="US-ASCII" in the form, but the user tries to submit > > Japanese characters, Firefox will send them as HTML entities like > > Ӓ whereas IE will ignore you and send UTF-8 (assuming your page > > was originally in UTF-8)? Bleh! > > Oh the pain! Does it start HTML quoting everything once it starts > adding entities (but not before)? Too bad there isn't a unicode option > for url escaping. And if you do multipart/form-data, does the encoding > show up there? Does the cgi module keep that information or throw it away? > > Clearly it would be nice to do this right, but "nice" isn't "easy". > Probably heuristics are also called for, as well as looking at the user > agent. And what about IE 7? > > This would probably be the kind of thing that would be nice to steal > from somewhere else (maybe a framework in another language). I'm > guessing Perl isn't a good source, they're probably as scrappy about > this stuff as we are; ditto PHP. Java? They'd care.
I think the morale of the story is keep it simple and stick to one of three options: 1. As a developer, if you only accept ASCII, don't present the page in UTF-8. From Paste's perspective, I think this will just work per item 3. 2. As a developer, if you're going use a charset other than Unicode, you should have to do something if you want Paste to decode things for you. 3. As a developer, you should show the page using UTF-8 and accept UTF-8 input. Paste should make it easy and decode things for you automatically. I apologize if I'm stating the obvious. -jj -- The one who gets the last laugh isn't the one who did the laughing, but rather the one who did the writing. _______________________________________________ Paste-users mailing list [email protected] http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users
