Read the old starter's key descriptions in code page 1250 too

Its language files are code page 1250 as often as UTF-8. Read as UTF-8 only,
Czech and Polish descriptions came out with replacement characters.
This commit is contained in:
maj00r
2026-11-03 21:51:55 +01:00
parent cf1ba319c1
commit 71c32c5b9a
2 changed files with 17 additions and 2 deletions

View File

@@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using StarterNG.Application.Abstractions;
using StarterNG.Infrastructure.Adapters;
namespace StarterNG.Services;
@@ -286,8 +286,9 @@ public class LocalizationService : INotifyPropertyChanged, ILocalizedStrings
if (path is null)
return;
// The old starter's own files are code page 1250 as often as UTF-8.
bool inDescriptions = false;
foreach (string line in File.ReadLines(path, Encoding.UTF8))
foreach (string line in LegacyText.Decode(File.ReadAllBytes(path)).ReplaceLineEndings("\n").Split('\n'))
{
if (line.Contains("<eu07_input-keyboard.ini", StringComparison.Ordinal))
{