[gopher] CAPS capability: ServerDefaultCharset

Kim Holviala kim at holviala.com
Sat Jan 3 14:51:29 UTC 2015


> On 03 Jan 2015, at 14:51, James Mills <prologic at shortcircuit.net.au> wrote:
> 
> This is really neat :) How do you "detect" the file's encoding btw?

It doesn’t detect the file encoding, it detects encoding per character on the fly. As in you can have both Latin-1 and UTF-8 on the same line in the same file and it will still do the right thing.

Look at the function strniconv() on string.c line 144. Not the easiest to understand because it has lots of bit handling - you should probably read & fully understand some UTF-8 docs before trying to figure out what my code does and why it works the way it does.



- Kim





More information about the Gopher-Project mailing list