using System.Text; using LibGit2Sharp.Core; namespace LibGit2Sharp { /// /// Provides helper overloads to a . /// public static class BlobExtensions { /// /// Gets the blob content decoded as UTF-8. /// /// The blob for which the content will be returned. /// Blob content as UTF-8 public static string ContentAsUtf8(this Blob blob) { Ensure.ArgumentNotNull(blob, "blob"); return Encoding.UTF8.GetString(blob.Content); } /// /// Gets the blob content decoded as Unicode. /// /// The blob for which the content will be returned. /// Blob content as unicode. public static string ContentAsUnicode(this Blob blob) { Ensure.ArgumentNotNull(blob, "blob"); return Encoding.Unicode.GetString(blob.Content); } } }