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

@@ -190,6 +190,20 @@ public class LocalizationTests
Assert.Equal(string.Empty, loc.Opt("Cmd.z"));
}
[Fact]
public void An_old_starters_key_descriptions_are_read_in_its_own_code_page()
{
using var folders = new Folders();
File.WriteAllText(Path.Combine(folders.Bundled, "en.xml"), English);
File.WriteAllBytes(Path.Combine(folders.OldStarter, "lang-cz.txt"), LegacyText.CodePage1250.GetBytes(
"[labels]\r\n<eu07_input-keyboard.ini\r\nhornhighactivate=Houkačka výšková\r\n\r\n"));
var loc = folders.Service();
loc.Load("cz");
Assert.Equal("Houkačka výšková", loc.Opt("Cmd.hornhighactivate"));
}
[Fact]
public void Of_the_simulators_files_only_a_language_code_counts()
{