4

Is it possible to write to a file in Go with a specific encoding like windows-1252 for instance?

4

2 回答 2

4

You will have to use a library to convert between encodings:

https://code.google.com/p/go-charset/

The library allows you to convert strings to and from encodings like windows-1252.

于 2013-10-28T16:48:07.213 回答
1

Project go.text provides utilities for this precise case, with a Windows-1252 charmap defined.

于 2013-10-28T16:52:18.143 回答