Compare commits

...

5 Commits
0.21 ... 0.21.1

Author SHA1 Message Date
Adam Hathcock
87e57e3a9a Mark for 0.21.1 2018-05-15 09:14:56 +01:00
Adam Hathcock
785d0dcebf Merge pull request #381 from adamhathcock/issue-380
Allow forced encoding to override default encoding
2018-05-15 09:13:16 +01:00
Adam Hathcock
2314776f55 Also check for CustomDecoder 2018-05-15 08:28:11 +01:00
Adam Hathcock
473f5d8189 Make GetDecoder use GetEncoding for forced 2018-05-14 16:20:57 +01:00
Adam Hathcock
be971cb6f7 Allow forced encoding to override default encoding 2018-05-14 16:08:31 +01:00
3 changed files with 10 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: microsoft/dotnet:2.0.7-sdk-2.1.105
- image: microsoft/dotnet:2.0.7-sdk-2.1.200
steps:
- checkout
- run:

View File

@@ -49,6 +49,11 @@ namespace SharpCompress.Common
#if NETSTANDARD1_0
return Decode(bytes, 0, bytes.Length);
#else
//allow forced and custom to override this.
if (CustomDecoder != null || Forced != null)
{
return Decode(bytes, 0, bytes.Length);
}
var extendedAsciiEncoding = Encoding.GetEncoding(437);
return extendedAsciiEncoding.GetString(bytes, 0, bytes.Length);
#endif
@@ -71,7 +76,7 @@ namespace SharpCompress.Common
public Func<byte[], int, int, string> GetDecoder()
{
return CustomDecoder ?? ((bytes, index, count) => (Default ?? Encoding.UTF8).GetString(bytes, index, count));
return CustomDecoder ?? ((bytes, index, count) => GetEncoding().GetString(bytes, index, count));
}
}
}

View File

@@ -2,9 +2,9 @@
<PropertyGroup>
<AssemblyTitle>SharpCompress - Pure C# Decompression/Compression</AssemblyTitle>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>0.21.0</VersionPrefix>
<AssemblyVersion>0.21.0</AssemblyVersion>
<FileVersion>0.21.0</FileVersion>
<VersionPrefix>0.21.1</VersionPrefix>
<AssemblyVersion>0.21.1</AssemblyVersion>
<FileVersion>0.21.1</FileVersion>
<Authors>Adam Hathcock</Authors>
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">net45;net35;netstandard1.0;netstandard1.3;netstandard2.0</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>