diff-match-patch
diff-match-patch copied to clipboard
Fix internal encoding left on UCS-2LE after switching to UCS-4LE.
After switching from UCS-2LE to UCS-4LE, the internal encoding is not updated but left on UCS-2LE. This means that mb_* functions using the default internal encoding will not return the correct results. I've included a simple text case of replacing an emoji from outside the Unicode BMP with another. Before this fix, it was generating a diff with partial multibye characters, which could not be converted back to the internal encoding.