rob, Why are you converting UTF-8 to ASCII for Windows 10? Convert UTF-8 to CP1252 (Windows-1252) or UTF16.
Corrected, corrected link. I will get it right eventually! For UTF-8 to CP1252: https://play.golang.org/p/vzupJY78XB <https://play.golang.org/p/BBiN2ihc02> Peter On Friday, May 5, 2017 at 9:11:16 PM UTC-4, rob solomon wrote: > > Hi. I decided to write a small program in Go to convert utf8 to simple > ASCII. This need arose by my copying a file created in Ubuntu 16.04 > amd64, and used on a win10 computer. > > I decided to first change ", ' and emdash characters. Using hexdump -C > in Ubuntu, the runes in the file are: > > open quote = 0xE2809C > > close quote = 0xE2809D > > apostrophe = 0xE28099 > > emdash = 0xE28094 > > > However, when I write a simple program to display these runes from the > file, using the routines in unicode/utf8, I get very different values. > I do not understand this. > > open quote = 0x201C > > close quote = 0x201D > > apostrophe = 0x2019 > > emdash = 0x2014. > > > Why are the runes returned by utf8.DecodeRuneInString different from > what hexdump shows when inspecting the file directly? > > --rob solomon > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.