开发者

Haskell: Converting between ByteStrings and different text encodings

I'd like to translate betw开发者_运维百科een Strings and ByteStrings using various encodings.

I know there is the utf8-string package which handles the UTF8 encoding. However, there are a lot of other encodings described in System.IO.

I also see the Data.Text package which can translate between String, Text and ByteString using different encodings.

What's the most appropriate way to translate between String and ByteString using the various encodings?


  • The straightforward way: http://hackage.haskell.org/package/encoding
  • Via iconv bindings: http://hackage.haskell.org/package/iconv-0.4.0.2
  • Via icu bindings: http://hackage.haskell.org/package/text-icu
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜