You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
I'm working message log in our app. We want to show diff of changes any user made on text posts. Those posts may include emoji characters but diff_match_patch replaces those characters with � character (but only if they changed in the text).
Looks like the diffing doesn't consider whether a character is non-ASCII and breaks unicode emojis in pieces if they are different but occupy the same space. That would result in some unknown character � after all is said and done. Assuming it's conversion related.
@ndvbd I ended up "solving" it by just escaping all the special unicode stuff with text = encodeURI(text) before saving the text (and using decodeURI(...) to undo it, of course). Bit of a hack but it works for my use case.
I'm working message log in our app. We want to show diff of changes any user made on text posts. Those posts may include emoji characters but diff_match_patch replaces those characters with � character (but only if they changed in the text).
The behaviour can be reproduced here:
https://neil.fraser.name/software/diff_match_patch/demos/diff.html
Paste 😉and 😀into textareas and compute the diff.
Why is this happening?