Skip to content

Commit

Permalink
copy @DrasilZA changes from PR #7
Browse files Browse the repository at this point in the history
  • Loading branch information
KaddaOK committed Jul 2, 2024
1 parent a1e550b commit 4fcdec0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions KaddaOK.AvaloniaApp.Windows/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Drawing;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Avalonia;
using Avalonia.Svg.Skia;
Expand All @@ -15,6 +17,10 @@ class Program
[STAThread]
public static void Main(string[] args)
{
CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
culture.NumberFormat.NumberDecimalSeparator = "."; //Force use . for regions that use ,
Thread.CurrentThread.CurrentCulture = culture;

try
{
BuildAvaloniaApp()
Expand Down
9 changes: 7 additions & 2 deletions KaddaOK.AvaloniaApp/ViewModels/ExportViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ protected async Task ExportToRzlrc()
if (file != null)
{
await using var stream = await file.OpenWriteAsync();
using var streamWriter = new StreamWriter(stream)
// UTF-16 LE BOM
Encoding encoding = new UnicodeEncoding(false, true);

using var streamWriter = new StreamWriter(stream, encoding)
{
AutoFlush = true
};
Expand Down Expand Up @@ -196,7 +199,9 @@ protected async Task ExportToRzlrc()
}

var projectContents = RzProjectSerializer.Serialize(generatedProject);
File.WriteAllText(projectPath, projectContents);
using var writer = new StreamWriter(projectPath, false, encoding);
await writer.WriteAsync(projectContents);

pathToLaunch = projectPath;
}

Expand Down

0 comments on commit 4fcdec0

Please sign in to comment.