diff --git a/scripts/sync_qnet.py b/scripts/sync_qnet.py index 37f417b..6478695 100644 --- a/scripts/sync_qnet.py +++ b/scripts/sync_qnet.py @@ -74,14 +74,18 @@ def ssh_exec(cmd: str, timeout: int = 60) -> dict: def fetch_one(station: str, ip: str, subdir: str) -> str: - """Fetcha Songs.txt z windows playerja, vrne UTF-8 string.""" + """Fetcha Songs.txt z windows playerja, vrne UTF-8 string. + + Songs.txt je v CP1250 encoding (Windows Slovenian/CE), NE 1252 (Western). + 1252 bi 'Č' (0xC8) interpretiral kot 'È', 'Š' kot 'Š' OK ampak 'Ž' (0xDE) kot 'Þ' itd. + """ # 1) scp z playerja na openclaw, iconv v utf8, base64 nazaj cmd = ( f"set -e; " f"TMP=$(mktemp); " f"scp -i {SSH_KEY} -o StrictHostKeyChecking=no " f'"folxadmin@{ip}:c:/{subdir}/Data/Songs.txt" "$TMP"; ' - f'iconv -f WINDOWS-1252 -t UTF-8 "$TMP" | base64 -w 0; ' + f'iconv -f WINDOWS-1250 -t UTF-8 "$TMP" | base64 -w 0; ' f'rm -f "$TMP"' ) res = ssh_exec(cmd, timeout=90)