英文:
Go iso-8859-1 encoding support in go.text
问题
我在我的项目中使用go.text库。
https://godoc.org/code.google.com/p/go.text/encoding
我不明白为什么它缺少iso-8859-1
编码?
我知道我可以很容易地进行转码:byte -> rune -> utf8
https://stackoverflow.com/questions/6002619/unmarshal-an-iso-8859-1-xml-input-in-go
但我想知道在go.text中是否有一些以不同名称命名的iso-8859-1
编码。我知道它有以下名称:
ISO_8859-1:1987
ISO-8859-1
iso-ir-100
ISO_8859-1
latin1
l1
IBM819
CP819
csISOLatin1
英文:
I use go.text in my project
https://godoc.org/code.google.com/p/go.text/encoding
I do not understand why it is missing iso-8859-1
?
I know I can easily transcode it byte -> rune -> utf8
https://stackoverflow.com/questions/6002619/unmarshal-an-iso-8859-1-xml-input-in-go
But I wonder if there is some encoding in go.text that is iso-8859-1
but named differently. I know it has following names.
ISO_8859-1:1987
ISO-8859-1
iso-ir-100
ISO_8859-1
latin1
l1
IBM819
CP819
csISOLatin1
答案1
得分: 5
你可以在iso-8859-1
的位置使用Windows1252
。
这种字符编码是ISO 8859-1的超集,但与IANA的ISO-8859-1不同,它在80到9F(十六进制)范围内使用可显示字符而不是控制字符。
http://en.wikipedia.org/wiki/Windows-1252
ISO-8859-1在此范围内分配了几个控制码。Windows-1252在这些码点上分配了几个字符、标点符号、算术和商业符号。
这里有一个显示差异的图表:
http://www.i18nqa.com/debug/table-iso8859-1-vs-windows-1252.html
英文:
You can use Windows1252
in place of iso-8859-1
.
> This character encoding is a superset of ISO 8859-1, but differs from the IANA's ISO-8859-1 by using displayable characters rather than control characters in the 80 to 9F (hex) range
http://en.wikipedia.org/wiki/Windows-1252
>ISO-8859-1 assigns several control codes in this range. Windows-1252 has several characters, punctuation, arithmetic and business symbols assigned to these code points.
There is a chart with the differences here:
http://www.i18nqa.com/debug/table-iso8859-1-vs-windows-1252.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论