diff options
author | Paul Betts <paul@paulbetts.org> | 2012-01-31 10:41:01 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-02-02 02:50:19 +0400 |
commit | e32dba45b0edc7283833d2daad19a5ccc6a6452c (patch) | |
tree | e9f70ad5576ca825a525d3ddc04d122089d2208b /LibGit2Sharp/Signature.cs | |
parent | 9196a4823cb75dea011a97b4f1b5a12b9d3c041b (diff) |
Strings in structures are being marshalled as ASCII, Hack fix it
Diffstat (limited to 'LibGit2Sharp/Signature.cs')
-rw-r--r-- | LibGit2Sharp/Signature.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/LibGit2Sharp/Signature.cs b/LibGit2Sharp/Signature.cs index 32075609..342c6ee4 100644 --- a/LibGit2Sharp/Signature.cs +++ b/LibGit2Sharp/Signature.cs @@ -13,13 +13,17 @@ namespace LibGit2Sharp private readonly string name; private readonly string email; + private static readonly Utf8Marshaler marshaler = new Utf8Marshaler(); + internal Signature(IntPtr signaturePtr) { var handle = new GitSignature(); Marshal.PtrToStructure(signaturePtr, handle); - name = handle.Name; - email = handle.Email; + // XXX: This is unbelievably hacky, but I can't get the + // Utf8Marshaller to work properly. + name = (string)marshaler.MarshalNativeToManaged(handle.Name); + email = (string)marshaler.MarshalNativeToManaged(handle.Email); when = Epoch.ToDateTimeOffset(handle.When.Time, handle.When.Offset); } |