Nope, there is no algo here, just my own code based on my reading of the offical docs. Basic idea: - first 128 bytes of US-ASCII & Latin-1 & UTF-8 are the same - first 256 bytes of Latin-1 & UTF-8 are the same - the way UTF-8 encodes >0x80 values is easy to detect from byte stream Based on that I made a function which: - first upconverts all three to 32-bit UTF - if output = US-ASCII use the translation table defined in gophernicus.h to downconvert 0x80 - 0xff to 7-bit - if output = Latin-1 let 0x00-0xff pass through and discard anything > 0xff - if output = UTF-8 just encode anything over 0x80 using the UTF-8 encoding - Kim |
_______________________________________________ Gopher-Project mailing list Gopher-Project@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project