AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Google diff match patch python example9/17/2023 ![]() ![]() It seems to me that the problem can be solved by replacing encodeURI/ decodeURI with escape/ unescape (or other prefered escape method) inside patch_fromText and toString, have you tried this? It seems to work fine for my use-case - I hope it doesn’t break something else. But it can occur inside an actual diff, too. This mostly happens with internally generated prefixes/suffixes, for example inside patch_addContext_ - dmp “allocates” a chunk which starts/ends in the middle of an emoji. The problem appears when multi-character unicode emojis get broken up into separate diffs inside a patch: '□'.length // 2ĮncodeURI("\ud83d") // malformed uri errorĮncodeURI("\udc9b") // malformed uri errorĮncodeURI("\uD83D\udc9b") // '%F0%9F%92%9B' Take it with a grain of salt though, as I might have easily missed something □
0 Comments
Read More
Leave a Reply. |