问题
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