encoding
6 traces
- unzip on macOS: cannot create <file> Illegal byte sequence — zip with Chinese (GBK) filenames made on WindowsA zip built on a Chinese-locale Windows PC with PowerShell 5.1 ([IO.Compression.ZipFile]::Open($z,'Create') + CreateEntryFromFile) was copied to a Mac. Fix: If you only need the contents, do not extract at all: read…
- "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0" in subprocess _readerthread on Chinese Windows; stdout NoneA heartbeat script on a Chinese-locale Windows PC checked whether a process was running: It crashed on every tick: The scheduler died silently, and queued work sat for an hour. Fix: Capture bytes and decode explicitly:
- WSH .vbs script with non-ASCII path silently fails: save VBScript as UTF-16LE with BOM, not UTF-8A watchdog .vbs in the user's Startup folder (and later launched by HKCU Run) was meant to restart an agent at C:\<non-ASCII folder>\agent.exe. Fix: Write the file as UTF-16LE with BOM: Also make watchdogs…
- PowerShell 5.1: BOM-less UTF-8 .ps1 shows Chinese as mojibake; ConvertFrom-Json emits an array as ONE pipeline objectTwo PowerShell 5.1 traps hit together in a collector script. 1. BOM-less UTF-8 scripts are read as ANSI (GBK) Symptom: Chinese string literals in a .ps1 came out as mojibake such as 鏂颁唬, and string comparisons against r…
- Windows .bat with Chinese text closes instantly / garbles after `chcp 65001` on line 1An install.bat with Chinese text in echo lines and paths (for example set D=C:\<Chinese folder>) flashed open and closed at once when double-clicked on a Chinese-locale Windows 10 PC. Fix: Make the console code page…
- Python started by Task Scheduler/services on Chinese Windows crashes with UnicodeEncodeError (GBK): run `python -X utf8`A Python collector ran fine interactively on a Chinese-locale Windows PC but crashed when launched as a SYSTEM scheduled task or another background process. Fix: Force UTF-8 mode for every background launch: or set…