Re: If not JSON, what then ?

----- Mail original -----
De: "Poul-Henning Kamp"

>>If you're ready to invent binary representations it's way
>> imple to specify utf8 as encoding than fall again on multiple
>> encoding trap which instead of helping anyone means everyone is
>> incompatible with everyone else in subtle way

>Please elaborate, I have no idea what your are talking about here.

I thouroughly mislike all the encoding dance and escaping one time it's UTF-8 another not.

It's too complex, people won't read it, just do their usual mess and assume it will work (just like they post garbage nowadays and add ISO-8859-1 boilerplate without checking anything. Encoding hints do not help, instead of wrong encoding failure you add combos of bad encoding hint + whatever failures)

Please use a simpler rule like
 1. Everything not explicitely encoded is UTF-8 with no escaping allowed (or escaping restricted to a shortlist, not generic escaping that people will apply to all codepoints several times over just in case, no BOM, no pseudo-BOM, if they write nonsensical UTF-8 it's *their* problem not the transport problem, as long as they respect basic UTF-8 rules)
 2. an UTF-8 header that does not validate in whatever version of the next hop unicode engine aborts the frame (if you don't want to learn UTF-8 restrict yourself to basic latin block in your headers, it's valid UTF-8 and no more complex than ASCII)
 3. anything that does not fit there must use binary with explicit binary flag

That is simple enough people will remember it, they will curse you but apply it, instead of fell-good rules that everyone follows approximatively with an explosion of special cases to handle all the approximation results

Regards,

-- 
Nicolas Mailhot

Received on Tuesday, 2 August 2016 12:43:15 UTC