On Tue, Jun 02, 2020 at 10:14:59PM +0200, Felix Quei?ner wrote: > I strongly recommend supporting utf-8 only. Noted, but... > I don't want to support more than one in my > code You don't have to! Support UTF-8 and you are spec compliant. > most libraries don't support more than UTF-8, UTF-16, UTF-32 and > ASCII. Oh, now that can't be true. Loads of content produced on Windows computers is saved in some silly legacy ISO-whatever encoding that Microsoft refuses to drop. Any library used by working programmers in the "real world" of commercial software needs to be able to deal with that, at least. > Encoding is hell It's really not that bad at all in a situation, like Gemini (and unlike Gopher!), where you get told precisely what the encoding is. AV-98 does this: --- if mime.startswith("text/"): encoding = mime_options.get("charset", "UTF-8") try: body = body.decode(encoding) except UnicodeError: print("Could not decode response body using %s encoding declared in header!" % encoding) return --- Hardly a nightmare! Cheers, Solderpunk
---
Previous in thread (9 of 54): 🗣️ solderpunk (solderpunk (a) SDF.ORG)
Next in thread (11 of 54): 🗣️ Petite Abeille (petite.abeille (a) gmail.com)