💾 Archived View for rawtext.club › ~sloum › geminilist › 001280.gmi captured on 2020-09-24 at 01:59:21. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Sean Conner sean at conman.org
Wed Jun 3 01:47:45 BST 2020
- - - - - - - - - - - - - - - - - - -
It was thus said that the Great Felix Queißner once stated:
I strongly recommend supporting utf-8 only. iconv -l lists 1179
possible/known encodings. I don't want to support more than one in my
code, most libraries don't support more than UTF-8, UTF-16, UTF-32 and
ASCII. And for UTF-16 and UTF-32 not even a difference between little
and big endian encoded data.
RFC-1436 (the gopher RFC) suggests ISO Latin1 (ISO-8859-1 if I'm notmistaken) for 8-bit character sets and says *nothing* about UTF-8 (ofcourse, it was written before UTF-8 was an RFC, three years later). Butmost of the gopher sites I hit these days are UTF-8---it's rare that Iactually encounter anything but UTF-8.
Secondly, Linux systems come with iconv. Not only is this a program, butit's also a library which is dead simple to use as there are only threefunctions:
iconv_t iconv_open(char const *tocode,char const *fromcode); size_t iconv(iconv_t cd,char **inbuf,size_t *inbytes,char **outbuf,size_t *outbytes); iconv_close(iconv_t cd);
and that's *if* you want to support conversion. The world is migrating toUTF-8 so I think this will be that big of an issue in the long term. And incase anyone is curious, I found bindings for
Lua Python Rust Go Haskell
(no comment on how well these bindings work, just that they exist).
-spc