Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 33086b5

Browse files
authored
Merge pull request #123 from Muinez/ongoing
Error string encoding fix
2 parents d428f0b + 1352e83 commit 33086b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

UI/MainWindow/MainWindowSPCompiler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public partial class MainWindow
3838

3939
private string CurrentErrorString;
4040

41+
private static readonly Encoding _ansi = Encoding.GetEncoding(1251);
42+
4143
/// <summary>
4244
/// Compiles the specified scripts.
4345
/// </summary>
@@ -231,7 +233,7 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
231233
if (File.Exists(errorFile))
232234
{
233235
hadError = false;
234-
var errorStr = File.ReadAllText(errorFile);
236+
var errorStr = Encoding.UTF8.GetString(Encoding.Convert(_ansi, Encoding.UTF8, _ansi.GetBytes(File.ReadAllText(errorFile, _ansi))));
235237
CurrentErrorString = errorStr;
236238
stringOutput.AppendLine(errorStr.Trim('\n', '\r'));
237239
var mc = errorFilterRegex.Matches(errorStr);

0 commit comments

Comments
 (0)