Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Output strings are garbled in Japanese environment #1203

Closed
HiroTamori opened this issue Feb 15, 2021 · 6 comments
Closed

Output strings are garbled in Japanese environment #1203

HiroTamori opened this issue Feb 15, 2021 · 6 comments
Labels
bug fixed-pending-release Fix is merged and will be included in the next release. i18n

Comments

@HiroTamori
Copy link

version 0.3.5 (this bug occurred at least 0.3.4 too)
on Windows 10 (Build 1909) Japanese edition
arduino-garbled
Workaround is comment the line 215 of out/src/common/util.js out;

        const child = childProcess.spawn(command, args, options);
        let codepage = "65001";
/*
        if (os.platform() === "win32") {
            try {
                const chcp = childProcess.execSync("chcp.com");
                codepage = chcp.toString().split(":").pop().trim();
            }
            catch (error) {
                outputChannel_1.arduinoChannel.warning(`Defaulting to code page 850 because chcp.com failed.\
                \rEnsure your path includes %SystemRoot%\\system32\r${error.message}`);
                codepage = "850";
            }
        }
*/
        if (outputChannel) {
            child.stdout.on("data", (data) => {

(Thanks nori-dev-akg san on the article)

This code seems to change UTF-8(codepage 65001) strings to Shift-JIS or something even it is not required by vscode.

@Tnze
Copy link

Tnze commented Feb 21, 2021

duplicated : #875, #958, #1096

@two-pack
Copy link
Contributor

two-pack commented Sep 3, 2021

PR #1237 fixed this problem on my environment.
It was already closed but not merged :(

@Tnze
Copy link

Tnze commented Sep 5, 2021

But why

@two-pack
Copy link
Contributor

two-pack commented Sep 5, 2021

PR #1237 fixed this problem on my environment.
It was already closed but not merged :(

I calmed myself down and checked again.

PR #364 in vscode-arduino added converting using chcp.com command on 13 Jul 2017.
Probably that time, incorrect characters, caused Arduino that output ansi codepage, was fixed.

PR #8289 in arduino/Arudino added encoding config of compiler log to arduino.l4j.ini. After that, Arduino outputs UTF-8 codepage by default.
Probably that time, incorrect characters, caused Arduino that output UTF-8 codepage, was occured again.

PR #1237 specifies the code page as fixed to UTF-8, so the correct characters are output.
But now I think better solution is reverting #364 because default log codepage is UTF-8 on latest Arduino. Or #1271.

benmcmorran added a commit that referenced this issue Jan 13, 2022
Fix for #1203 Using the codepage with arduino.l4j.ini on win32
@benmcmorran
Copy link
Member

This issue should be fixed by PR #1271 which has merged and will be included in the next release of this extension. If you'd like to test the changes before they are released, you can download and install the build artifact.

@benmcmorran benmcmorran added the fixed-pending-release Fix is merged and will be included in the next release. label Jan 13, 2022
@github-actions
Copy link

This issue has been fixed in the latest release of this extension, which is available in the VS Code extension marketplace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed-pending-release Fix is merged and will be included in the next release. i18n
Projects
None yet
Development

No branches or pull requests

5 participants