Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow quoted charset #108

Merged
merged 7 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion azure-pipelines/templates/stages/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ stages:

- job: TestMacOS
pool:
vmImage: macos-latest
vmImage: macos-11

steps:
- template: ../restore.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.12" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/fiskaltrust.Launcher/Commands/HostCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public async Task<int> InvokeAsync(InvocationContext context)
.WriteTo.GrpcSink(packageConfiguration, processHostService)
.CreateLogger();

System.Text.Encoding.RegisterProvider(new LauncherEncodingProvider());

var builder = Host.CreateDefaultBuilder()
.UseSerilog()
.ConfigureServices(services =>
Expand Down
8 changes: 4 additions & 4 deletions src/fiskaltrust.Launcher/ProcessHost/ProcessHostMonarch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public ProcessHostMonarch(ILogger<ProcessHostMonarch> logger, LauncherConfigurat
"--launcher-configuration", $"\"{Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(launcherConfiguration.Serialize()))}\"",
});

if (Debugger.IsAttached)
{
_process.StartInfo.Arguments += " --debugging";
}
// if (Debugger.IsAttached)
volllly marked this conversation as resolved.
Show resolved Hide resolved
// {
// _process.StartInfo.Arguments += " --debugging";
// }
_process.StartInfo.RedirectStandardInput = true;
_process.StartInfo.RedirectStandardError = true;
_process.StartInfo.RedirectStandardOutput = true;
Expand Down
22 changes: 22 additions & 0 deletions src/fiskaltrust.Launcher/Services/EncodingProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Text;

namespace fiskaltrust.Launcher.Services
{
public class LauncherEncodingProvider : EncodingProvider
{
public override Encoding? GetEncoding(int codepage) => CodePagesEncodingProvider.Instance.GetEncoding(codepage);

public override Encoding? GetEncoding(string name)
volllly marked this conversation as resolved.
Show resolved Hide resolved
{
if ((name.StartsWith('"') && name.EndsWith('"')) || (name.StartsWith('\'') && name.EndsWith('\'')))
volllly marked this conversation as resolved.
Show resolved Hide resolved
{
// This does not lead to an endless recursion, because every time the Encoding.GetEncoding(string) method calls this method either more quotes are trimmed and its recursed or null is returned.
return Encoding.GetEncoding(name.Substring(1, name.Length - 2));
}
else
{
return null;
}
}
}
}
5 changes: 3 additions & 2 deletions src/fiskaltrust.Launcher/fiskaltrust.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CoreWCF.Http" Version="1.3.2" />
<PackageReference Include="CoreWCF.NetTcp" Version="1.3.2" />
<PackageReference Include="CoreWCF.Http" Version="1.4.1" />
<PackageReference Include="CoreWCF.NetTcp" Version="1.4.1" />
<PackageReference Include="fiskaltrust.interface" Version="1.3.50-rc1" />
<PackageReference Include="fiskaltrust.Middleware.Abstractions" Version="1.3.3" />
<PackageReference Include="fiskaltrust.Middleware.Interface.Client.Soap" Version="1.3.50-rc2" />
Expand All @@ -33,6 +33,7 @@
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
<PackageReference Include="DiffPlex" Version="1.7.1" />
<PackageReference Include="MQTTnet" Version="4.3.1.873" />
volllly marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="AutoBogus" Version="2.13.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0-rc.8",
"version": "2.0.0-rc.9",
"releaseBranches": [
"^refs/tags/v\\d+(?:\\.\\d+)*(?:-.*)?$"
]
Expand Down
Loading