Open rtfeldman opened 1 year ago
OCaml REPL session using the uuseg
(linked to source code) library:
# #require "uuseg.string";;
# List.rev (Uuseg_string.fold_utf_8 `Grapheme_cluster (fun list segment -> segment :: list) [] "๐ฉโ๐ฉโ๐ฆโ๐ฆ");;
- : string list = ["๐ฉโ๐ฉโ๐ฆโ๐ฆ"]
For some additional context to this issue, the plan is to remove unicode text segmentation from builtins and move to a library over at roc-lang/unicode. That is a work in progress.
To reproduce:
The
toScalars
part is correct, buttoGraphemes
is incorrect. It should return["๐ฉโ๐ฉโ๐ฆโ๐ฆ"] : List Str
- just one element in the list.Swift does this correctly.