Skip to content

output utf8 chars incorrect #25

Closed
Closed
@yufengzjj

Description

@yufengzjj

python3.5.2
out

Activity

formulahendry

formulahendry commented on Oct 30, 2016

@formulahendry
Owner

You may try below two options for this issue:
1.Use chcp to set code page of consloe

{
    "code-runner.executorMap": {
        "python": "chcp 65001 | py"
    }
}

2.Run it in built-in terminal to see if it works (I have not tested it, but should work)

{
    "code-runner.runInTerminal": true
}
yufengzjj

yufengzjj commented on Oct 30, 2016

@yufengzjj
Author

only set running in terminal works.
if it can run normally not in origin terminal it would be great.

formulahendry

formulahendry commented on Oct 30, 2016

@formulahendry
Owner

So the first method is not working? Could you show me the output? And could you try "chcp 65001 & py" and show me the output?

yufengzjj

yufengzjj commented on Oct 30, 2016

@yufengzjj
Author

default codepage 936
----main.py---
print("呵呵")
output:
out

formulahendry

formulahendry commented on Oct 30, 2016

@formulahendry
Owner

Could you please try run py *** and chcp 65001 & py *** in OS terminal (cmd?)

yufengzjj

yufengzjj commented on Oct 31, 2016

@yufengzjj
Author

same main.py:
1
run chcp 65001 & py -3 main.py:
2

formulahendry

formulahendry commented on Nov 28, 2016

@formulahendry
Owner

Hi @yufengzjj , this issue is similar to #33 , and @sunqi1993 has found a way to resolve it. Could you please have a try to see whether it works for you?

{
    "code-runner.executorMap": {
        "python": "set PYTHONIOENCODING=utf8 && python"
    }
}

image

yufengzjj

yufengzjj commented on Nov 28, 2016

@yufengzjj
Author

it works:
image

xcf007

xcf007 commented on Sep 15, 2017

@xcf007

java的输出也乱码

formulahendry

formulahendry commented on Sep 15, 2017

@formulahendry
Owner

@xcf007 Did you try these two methods? #25 (comment)

xcf007

xcf007 commented on Sep 15, 2017

@xcf007

"code-runner.runInTerminal": true
谢谢,这个可以了。另外 JAVA_HOME没设置,这个不想全局修改环境变量,再vsc里可以配吗,我java.home配置了没起作用

formulahendry

formulahendry commented on Sep 15, 2017

@formulahendry
Owner

You could set Java path in below settings:

"code-runner.executorMap": {
        "java": "/foo/bar/java ****"
}
fusen-github

fusen-github commented on Dec 13, 2017

@fusen-github

如何设置,既能支持python3,又可以输出中文?

blurhead

blurhead commented on Feb 15, 2019

@blurhead

export PYTHONENCODING=utf8 && python fileName, it works for me in macOS

iamhectorotero

iamhectorotero commented on Jul 6, 2020

@iamhectorotero

Did you mean to type

export PYTHONIOENCODING=utf8

@blurhead?

Antecer

Antecer commented on May 16, 2024

@Antecer
"code-runner.executorMap": {
    "c": "cd $dir && gcc $fileName -o R:/$fileNameWithoutExt && R:/$fileNameWithoutExt && del R:/$fileNameWithoutExt.exe"
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @formulahendry@xcf007@iamhectorotero@yufengzjj@Antecer

        Issue actions

          output utf8 chars incorrect · Issue #25 · formulahendry/vscode-code-runner