Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,593 changes: 0 additions & 1,593 deletions TestResults/ApiBuilderTests-windows-net11.0-report.html

This file was deleted.

1,593 changes: 0 additions & 1,593 deletions TestResults/Tests-windows-net10.0-report.html

This file was deleted.

1,593 changes: 0 additions & 1,593 deletions TestResults/Tests-windows-net48-report.html

This file was deleted.

2 changes: 1 addition & 1 deletion apiCount.include.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**API count: 749**
**API count: 750**
1 change: 1 addition & 0 deletions api_list.include.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
* `string GetString(ReadOnlySpan<byte>)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.getstring?view=net-11.0#system-text-encoding-getstring(system-readonlyspan((system-byte))))
* `bool TryGetBytes(ReadOnlySpan<char>, Span<byte>, int)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.trygetbytes?view=net-11.0)
* `bool TryGetChars(ReadOnlySpan<byte>, Span<char>, int)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.trygetchars?view=net-11.0)
* `Latin1` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.latin1?view=net-11.0)


#### Enum
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The package targets `netstandard2.0` and is designed to support the following ru
* `uap10`


**API count: 749**<!-- singleLineInclude: apiCount. path: /apiCount.include.md -->
**API count: 750**<!-- singleLineInclude: apiCount. path: /apiCount.include.md -->


**See [Milestones](../../milestones?state=closed) for release notes.**
Expand Down Expand Up @@ -711,6 +711,7 @@ The class `Polyfill` includes the following extension methods:
* `string GetString(ReadOnlySpan<byte>)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.getstring?view=net-11.0#system-text-encoding-getstring(system-readonlyspan((system-byte))))
* `bool TryGetBytes(ReadOnlySpan<char>, Span<byte>, int)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.trygetbytes?view=net-11.0)
* `bool TryGetChars(ReadOnlySpan<byte>, Span<char>, int)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.trygetchars?view=net-11.0)
* `Latin1` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.latin1?view=net-11.0)


#### Enum
Expand Down
5 changes: 5 additions & 0 deletions src/Consume/Consume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ void Enum_Methods()
values = Enum.GetValuesAsUnderlyingType<DayOfWeek>();
}

void Encoding_Methods()
{
var latin1 = Encoding.Latin1;
}

void Environment_Methods()
{
var processPath = Environment.ProcessPath;
Expand Down
18 changes: 18 additions & 0 deletions src/Polyfill/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#if !NET5_0_OR_GREATER

namespace Polyfills;

using System.Text;

static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.latin1?view=net-11.0
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
#endif
14 changes: 14 additions & 0 deletions src/Split/net461/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/net462/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/net47/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/net471/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/net472/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/net48/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/net481/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netcoreapp2.0/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netcoreapp2.1/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netcoreapp2.2/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netcoreapp3.0/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netcoreapp3.1/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netstandard2.0/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/netstandard2.1/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
14 changes: 14 additions & 0 deletions src/Split/uap10.0/EncodingPolyfill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// <auto-generated />
#pragma warning disable
namespace Polyfills;
using System.Text;
static partial class Polyfill
{
extension(Encoding)
{
/// <summary>
/// Gets an encoding for the Latin1 character set (ISO-8859-1).
/// </summary>
public static Encoding Latin1 => Encoding.GetEncoding(28591);
}
}
8 changes: 8 additions & 0 deletions src/Tests/PolyfillTests_Encoding.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
partial class PolyfillTests
{
[Test]
public async Task Encoding_Latin1()
{
var latin1 = Encoding.Latin1;
await Assert.That(latin1).IsNotNull();
await Assert.That(latin1.CodePage).IsEqualTo(28591);
}

#if FeatureMemory
[Test]
public async Task Encoding_GetByteCount()
Expand Down