Skip to content

vswhere.exe uses local code page to emit invalid JSON/XML #146

@Suzumizaki

Description

@Suzumizaki

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions