I merged and adapted the code from Peter:

https://github.com/c-cube/ocaml-containers/blob/master/src/core/CCUtf8_string.mli
https://github.com/c-cube/ocaml-containers/blob/master/src/core/CCUtf8_string.ml

it's stricter (only accepts valid UTF8) and the random tests should
ensure that it agrees with Uutf on what is valid utf8, and on the list
of codepoints of a valid UTF8 string.

The code is not that complicated: encoding is 25 lines, decoding is 67
lines. I had to rewrite part of it to make it strictly UTF8 compliant.

Comments very welcome! And thanks again to Peter, without whom I'd never
have had the courage to do it.

-- 
Simon Cruanes

http://weusepgp.info/
key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3  7D8D 4AC0 1D08 49AA 62B6

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Containers-users mailing list
Containers-users@lists.ocaml.org
http://lists.ocaml.org/listinfo/containers-users

Reply via email to