Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: How do I know what encoding was used for form input?

by itub (Priest)
on Aug 11, 2005 at 14:57 UTC ( [id://482984]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I know what encoding was used for form input?
in thread How do I know what encoding was used for form input?

That's right, there's no real standard way of telling a client how the URI for a GET should be encoded (and even if there is for POST, it seems most clients don't comply). However, practical experience with mainstream browsers lead to this conclusion (http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html).
By now (2005) the robust way to deal with this issue is to send out forms pages encoded in utf-8, expecting the forms input to be submitted back using that encoding. This has been in practical use for a couple of years now (e.g at Google) and can be expected to work with any current HTML4-compatible browser. However, there are other browsers still in use which don't fit this description, so it still seems relevant to look at the theory and compare it with observations.

I've used this approach for several websites and it works with all the (reasonably recent) browsers I've tested.

"In theory, theory and practice are the same, but in practice, they never are."

Replies are listed 'Best First'.
Re^4: How do I know what encoding was used for form input?
by jhourcle (Prior) on Aug 11, 2005 at 16:01 UTC

    Thanks for the reference -- I know sgifford had given it as well, but he seemed to just be quoting it, rather than mentioning the information it contained.

    I hadn't seen the 'buzzword' concept presented before, but it seems like a simple hack to validate what's being sent back to you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://482984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found