automerge / automerge-swift

Swift language bindings presenting Automerge
https://automerge.org/automerge-swift/documentation/automerge/
MIT License
217 stars 11 forks source link

SplitText operation seems not using UTF-8 encoding #91

Closed miguelangel-dev closed 5 months ago

miguelangel-dev commented 6 months ago

Maybe I am not consuming the API as it is expected.

Insert a single text ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง into a new Automerge.Document is expected to have a length equal to ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง.utf8.count. But it is retrieving a non-expected length.

After doing some checks I can confirm the next:

heckj commented 6 months ago

./cc @alexjg

heckj commented 5 months ago

Thank you for this example setup - I've incorporated it into #99, and with it found a number of issues elsewhere in the higher level apis that were using the incorrect assumptions about UTF-8 code points, which are also resolved with #99. I'm closing this PR, with the relevant code sample illustrating what's working in #99 - and with multiple verifications there.

miguelangel-dev commented 5 months ago

@heckj Thanks for all the work around it, and the new version - it is really helpful