Does `string` in OCaml support UTF-8?

女生的网名这么多〃 提交于 2019-12-06 17:56:44

问题


Does the type string in OCaml support utf8?

Or what library I should use for utf8 string?


回答1:


The string type of OCaml consists of a series of 8-bit bytes in essence. You can store a UTF-8 value in a string, and I have often done this. However, there's no built-in support for handling them. A good library for handling Unicode in OCaml (so I've heard) is Camomile.




回答2:


There is also Uutf if you're looking for just unicode conversion.



来源:https://stackoverflow.com/questions/16152005/does-string-in-ocaml-support-utf-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!