NodeGit uses substring with bytes length comes from strlen but JavaScript requires characters length. So non-ascii string will be broken. https://libgit2.github.com/libgit2/#HEAD/type/git_diff_line git_diff_line->content_len : Number of bytes of data NodeGit: https://github.com/nodegit/nodegit/blob/v0.5.0/lib/convenient_line.js#L71 Some other implementations: https://github.com/libgit2/rugged/blob/v0.23.3/ext/rugged/rugged_diff_line.c#L68 https://github.com/libgit2/libgit2sharp/blob/v0.21.1/LibGit2Sharp/Core/EncodingMarshaler.cs#L129 https://github.com/libgit2/objective-git/blob/0.8.8/ObjectiveGit/GTDiffLine.m#L22 Thx.
NodeGit uses substring with bytes length comes from strlen but JavaScript requires characters length.
So non-ascii string will be broken.
https://libgit2.github.com/libgit2/#HEAD/type/git_diff_line
git_diff_line->content_len : Number of bytes of data
NodeGit:
https://github.com/nodegit/nodegit/blob/v0.5.0/lib/convenient_line.js#L71
Some other implementations:
https://github.com/libgit2/rugged/blob/v0.23.3/ext/rugged/rugged_diff_line.c#L68
https://github.com/libgit2/libgit2sharp/blob/v0.21.1/LibGit2Sharp/Core/EncodingMarshaler.cs#L129
https://github.com/libgit2/objective-git/blob/0.8.8/ObjectiveGit/GTDiffLine.m#L22
Thx.