sergi / go-diff

Diff, match and patch text in Go
MIT License
1.81k stars 207 forks source link

fix DiffCleanupSemantic #107

Closed pakohan closed 4 years ago

pakohan commented 4 years ago

currently, DiffCleanupSemantic only works for Ascii chars. In our company we've got Chinese chars as well, so the DiffCleanupSemantic does not work there since len("新") != len([]rune("新")).

See: https://play.golang.org/p/oTXcxo0gH1R

The Python lib has the same behaviour like the fixed version.