Closed m-spitfire closed 1 year ago
oops, sorry for notification, just "\u{codepoint}"
works...
First code point | Last code point | Byte 1 | Byte 2 | Byte 3 | Byte 4 |
---|---|---|---|---|---|
U+0000 | U+007F | 0xxxxxxx | |||
U+0080 | U+07FF | 110xxxxx | 10xxxxxx | ||
U+0800 | U+FFFF | 1110xxxx | 10xxxxxx | 10xxxxxx | |
U+10000 | U+10FFFF | 11110xxx | 10xxxxxx | 10xxxxxx | 10xxxxxx |
character
'0020' . '10FFFF' - '"' - '\'
'\' escape
You can implement a function that converts a code point into a stream of bytes, and call Bytes.to_string
.
Reference: https://en.wikipedia.org/wiki/UTF-8#Encoding
Thanks @bonjune!
Name: Murad Bashirov
Hello. I'm trying to generate a character from unicode codepoint as described in the json specification:
But from my search in ocaml you have to use an external library like uutf to do this, is there a way to do without an external library?