Archisteamfarm: Console uses incorrect encoding on Windows 7/8/8.1

Created on 23 Jun 2019  ·  4Comments  ·  Source: JustArchiNET/ArchiSteamFarm

Bug report

Description

Usual ASF console logging shows unreadable characters in earlier Windows versions (probably Unicode console isn't supported at all there)

Expected behavior

ASF properly writing output to console

Current behavior

Unreadable characters showing up in the console
image

Possible solution

Check Windows version (correctly working on "Microsoft Windows 10", incorrectly on "Microsoft Windows 6" and earlier ones)

Steps to reproduce

  1. Start ASF on Windows 7
  2. Bug occurs

Full log.txt recorded during reproducing the problem

2019-06-23 01:07:46|dotnet-944|INFO|ASF|InitASF() ArchiSteamFarm V4.0.2.4 (generic/8a8050bf-186e-476e-b049-84277f1ae031 | Microsoft Windows 6.1.7601 S)
2019-06-23 01:07:47|dotnet-944|INFO|ASF|InitGlobalDatabaseAndServices() Похоже, вы впервые запустили программу, добро пожаловать!
2019-06-23 01:07:57|dotnet-944|WARN|ASF|InitGlobalDatabaseAndServices() Пожалуйста, просмотрите наш раздел политики конфиденциальности на wiki, если вас беспокоит то, что делает ASF на самом деле!

Global ASF.json config (if using one)

{
  "CurrentCulture": "ru-RU"
}

BotName.json config of all affected bot instances (if more than one)

None

Additional info

Though Windows 7/8.1 are rather outdated, their extended support ends on January 14, 2020 and January 10, 2023 respectively, so in my opinion ASF should support them.

Bug Confirmed Low priority

All 4 comments

Actually, windows 7 supports Unicode console, but it has a raster font by default, and raster fonts don't support Unicode. Changing console font to TTF font with unicode support, such as Lucida Console, solves the issue. However, this should be noted at least in FAQ, and maybe ASF should show some kind of warning about it (in English and without translation).

I swear that windows is the most painful OS to work with, the amount of shit going on in the most fundamental parts of the system is overwhelming.

@Vital7 Check if changing UTF8 to Unicode in https://github.com/JustArchiNET/ArchiSteamFarm/blob/master/ArchiSteamFarm/OS.cs#L42 fixes your issue on previous Windows versions, it probably won't but there is a small chance that Windows will map out-of-bound characters to native codepage instead of garbage. Yes, it's irrational even for me, but worth checking.

I need to think how I want to deal with it, for now I'm heading towards ASF not touching console encoding at all.

@JustArchi it works! Built from the latest commit, changed that one line in OS.cs
image

Kill me already... thanks.

Piece of garbage.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KazeZlat picture KazeZlat  ·  4Comments

guihkx picture guihkx  ·  3Comments

light444 picture light444  ·  3Comments

undefo picture undefo  ·  4Comments

NanoAi picture NanoAi  ·  3Comments