mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-20 07:21:21 +02:00
Create WireMock.Net.MimePart project (#1300)
* Create WireMock.Net.MimePart project * . * REFACTOR * ILRepack * -- * ... * x * x * . * fix * public class MimePartMatcher * shared * min * . * <!--<DelaySign>true</DelaySign>--> * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
44
src/WireMock.Net.Minimal/Util/CultureInfoExtensions.cs
Normal file
44
src/WireMock.Net.Minimal/Util/CultureInfoExtensions.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace WireMock.Util;
|
||||
|
||||
internal static class CultureInfoUtils
|
||||
{
|
||||
public static readonly CultureInfo CultureInfoEnUS = new("en-US");
|
||||
|
||||
public static CultureInfo Parse(string? value)
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
return CultureInfo.CurrentCulture;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
#if !NETSTANDARD1_3
|
||||
if (int.TryParse(value, out var culture))
|
||||
{
|
||||
return new CultureInfo(culture);
|
||||
}
|
||||
#endif
|
||||
if (string.Equals(value, nameof(CultureInfo.CurrentCulture), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return CultureInfo.CurrentCulture;
|
||||
}
|
||||
|
||||
if (string.Equals(value, nameof(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return CultureInfo.InvariantCulture;
|
||||
}
|
||||
|
||||
return new CultureInfo(value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return CultureInfo.CurrentCulture;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user