diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2012-06-08 18:16:47 +0400 |
---|---|---|
committer | Keith Dahlby <dahlbyk@gmail.com> | 2012-06-08 18:18:42 +0400 |
commit | 78eb071ae323c61b86d6fdc9fdbe9ac3b8eab6b8 (patch) | |
tree | f1300c0e02a7933f0c3f0d548847ddd561cf8825 /LibGit2Sharp/ContentChanges.cs | |
parent | f23436b236902e86fbbaa807300fb725e89db4de (diff) |
Add Utf8Marshaler.FromManaged() and FromNative()
Diffstat (limited to 'LibGit2Sharp/ContentChanges.cs')
-rw-r--r-- | LibGit2Sharp/ContentChanges.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/LibGit2Sharp/ContentChanges.cs b/LibGit2Sharp/ContentChanges.cs index b9913538..e0064179 100644 --- a/LibGit2Sharp/ContentChanges.cs +++ b/LibGit2Sharp/ContentChanges.cs @@ -10,7 +10,6 @@ namespace LibGit2Sharp public class ContentChanges { private readonly StringBuilder patchBuilder = new StringBuilder(); - private static readonly Utf8Marshaler marshaler = (Utf8Marshaler)Utf8Marshaler.GetInstance(string.Empty); protected ContentChanges() { @@ -47,7 +46,7 @@ namespace LibGit2Sharp private int HunkCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, IntPtr header, uint headerlen) { - string decodedContent = marshaler.NativeToString(header, headerlen); + string decodedContent = Utf8Marshaler.FromNative(header, headerlen); PatchBuilder.AppendFormat("{0}", decodedContent); return 0; @@ -55,7 +54,7 @@ namespace LibGit2Sharp private int LineCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineorigin, IntPtr content, uint contentlen) { - string decodedContent = marshaler.NativeToString(content, contentlen); + string decodedContent = Utf8Marshaler.FromNative(content, contentlen); string prefix; |