4 ms·
Once you accept that urls don't even specify the character encoding, you realize it's impossible in general.
by michael1999 6y ago
Once you accept that urls don't even specify the character encoding, you realize it's impossible in general.
- jgalt212 6y agonon-ASCII URLs mainly serve to make it easier for scammers to steal from senior citizens.
- michael1999 6y agoLol, no. Germany is a real place. So is China. Bad luck for us that urls are just a bit to old to be assumed utf8.
- rambojazz 6y agoPlaintext files do not either.
- michael1999 6y agoAnd handling plaintext files on the internet reliably is similarly broken.
- Doxin 5y agoAren't urls quite specifically an ASCII subset? As soon as you stray outside that range any sane program is going to url-encode/idna-encode depending on where in the url the character is.
- michael1999 5y agoThey are _encoded_ as ASCII. But they very explicitly support arbitrary octets. The interpretation of those octets, and the timing of decode is where the fun starts. Quick quiz: How many hierarchy elements are present? http://example.com/one%2Ftwo/three http://example.com/one%2Ftwo/three If your Apache config has a proxy for `/one`, does that url match? What is the value of the utf8 param? http://example.com/frosty?utf8=%26%C7 http://example.com/frosty?utf8=%26%C7 application/x-www-form-urlencoded historically didn't specify encoding either. So POST doesn't save you. It is bad, and just gets worse. HTML/HTTP are just a bit too old to benefit from the genius of Ken Thompson. They started absolutely ignorant of character encoding. Berners-Lee was a physicist who just wanted to share some cat memes. https://tools.ietf.org/html/rfc1738#section-2.2 https://tools.ietf.org/html/rfc1738#section-2.2 https://blogs.warwick.ac.uk/kieranshaw/entry/utf-8_internationalisation_with https://blogs.warwick.ac.uk/kieranshaw/entry/utf-8_internati...