This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22734 - How is the default character encoding determined to decode application/x-www-form-urlencoded payloads?
Summary: How is the default character encoding determined to decode application/x-www-...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-19 09:46 UTC by contributor
Modified: 2013-09-13 22:32 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-07-19 09:46:16 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#url-encoded-form-data
Complete: http://www.whatwg.org/c#url-encoded-form-data
Referrer: 

Comment:
How is the default character encoding determined to decode
application/x-www-form-urlencoded payloads?

Posted from: 207.218.72.65
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
Comment 2 Simon Sapin 2013-07-24 23:31:07 UTC
The way I’m reading this, the default character encoding is an input to the * decode application/x-www-form-urlencoded payloads* algorithm. My question is, how are the users of the algorithm (none of which appear to be in this spec) expected to pick an encoding?
Comment 3 Ian 'Hixie' Hickson 2013-07-25 23:47:26 UTC
Oh, I see. My bad. I thought you meant how is the character encoding determined.

There's no good way to pick one. If you happen to know what encoding was likely to have been used, then you can set that (e.g. if your page is Win1252, and it has a form, and you are decoding the form results, then it's slightly more likely than not that the encoding is Win1252, so that'd be a default worth using), but there's no real way to know.
Comment 4 Ian 'Hixie' Hickson 2013-09-12 21:28:04 UTC
Would it help if the spec said this?
Comment 5 Ian 'Hixie' Hickson 2013-09-13 22:32:45 UTC
I put that in the spec.
Comment 6 contributor 2013-09-13 22:32:54 UTC
Checked in as WHATWG revision r8183.
Check-in comment: Add more colour around application/x-www-form-urlencoded decoding.
http://html5.org/tools/web-apps-tracker?from=8182&to=8183