💾 Archived View for rawtext.club › ~sloum › geminilist › 001261.gmi captured on 2020-09-24 at 02:00:08. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
solderpunk solderpunk at SDF.ORG
Tue Jun 2 21:51:13 BST 2020
- - - - - - - - - - - - - - - - - - -
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 Windowscomputers is saved in some silly legacy ISO-whatever encoding thatMicrosoft refuses to drop. Any library used by working programmersin the "real world" of commercial software needs to be able to dealwith that, at least.
Encoding is hell
It's really not that bad at all in a situation, like Gemini (andunlike 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