-
Notifications
You must be signed in to change notification settings - Fork 101
Description
When I run vswhere -products * -legacy -format json under the Japanese mode/edition/version of Windows 10 Pro, I got one of the line:
"description": "学生、オープン ソース、および個々の開発者のための無料で完全な機能を備えた IDE",
The message above is correct, but encoded by code-page 932 (The default codec for Japanese mode).
Today, As described in RFC 8259, at the section "8.1. Character Encoding", JSON files MUST use UTF-8 (and must NOT use byte-order-mark). Please use UTF-8, to make the valid JSON even when it includes non-ASCII string like above. Otherwise, valid JSON decoders claim the JSON file as invalid, especially they process the file as including bad Javascript \ escapes.
Almost same thing about vswhere -products * -legacy -format xml. vswhere.exe uses local code page (cp932, under my environment) without encoding declaration at the beginning of xml file. To simplify, just hard-code to use UTF-8.
On the other hand, default format mode (-format text or not using -format) should use local code page, I think. Otherwise it shows unreadable strings(mojibake) in the window of cmd.exe.