Skip to content

wrong output encoding #100

Closed
Closed

Description

From Igor Novozhilov (@IgorNovozhilov) on April 6, 2017 20:13

Environment data

VS Code version: 1.11.1
Python Extension version: 0.6.0
Python Version: 3.3
OS and version: win7 pro RU-ru

Actual behavior

image

Expected behavior

image

Steps to reproduce:

  • open github.com/DonJayamanne/pythonVSCode project
  • write #TODO: Сделать это

Your settings.json:

https://github.com/DonJayamanne/pythonVSCode/blob/master/.vscode/settings.json

with "python.linting.enabled": true

Copied from original issue: DonJayamanne/pythonVSCode#861

Activity

  1. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    From Igor Novozhilov (@IgorNovozhilov) on April 6, 2017 20:15

    This is in continuation of this issue: https://github.com/DonJayamanne/pythonVSCode/issues/844

  2. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    From Igor Novozhilov (@IgorNovozhilov) on April 6, 2017 20:33

    The problem is that all the methods open, you must use the parameter encoding. Which indicate the current encoding of the file.
    image

  3. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    From Igor Novozhilov (@IgorNovozhilov) on April 6, 2017 20:51

    And required to set the current OS encoding to run the commands child_process.execFile. So, as, it uses the encoding utf8. And starts cmd.exe on Windows, which uses the encoding cp866 in RU-ru localization.

    Or you can not use child_process.execFile and child_process.exec. And always use 'child_process.spawn', which runs without a flag shell default.
    https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options

    image

    image

    image

  4. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    Not sure if I follow you here. Why didn't using execFile work, it is using utf8, I thought that would work.

  5. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    Thanks for your help here

  6. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    From Igor Novozhilov (@IgorNovozhilov) on April 7, 2017 5:47

    Let me demonstrate by the example of the module iconv-lite.
    This is a very very old problem of os windows: nodejs/node-v0.x-archive#2190
    Example:

    var ivl = require('iconv-lite');
    
    var buf = child_process.execSync('echo Привет мир')
    
    console.log(buf.toString('utf-8'))
    console.log(ivl.decode(buf, 'cp866'));

    image

  7. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    Thanks for the excellent instructions. I have been able to replicate it with the above instructions.
    I'm in the process of setting up my PC so I can simulate this issue in VS Code and test this correctly for a release.

    Please bear with me for now.
    FYI - I'll be releasing a new version without a fix for this, rest assured this is the next thing I'll be working on (already started downloading a 4Gb update to my PC, will take the whole night to run the damn windows update).

  8. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    Managed to replicate in VS Code, now to start fixing this damn issue.

  9. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    Igor Novozhilov (@IgorNovozhilov) I believe I can solve this, by putting a special case for CP866. Will look into #844, as that's a slightly different problem, cuz I'm using a 3rd party library Jedi.

  10. d3r3kk commented on May 14, 2018

    @d3r3kk

    Hi folks!
    I took this one on this afternoon, creating a Win7 VM with RU language as the default input, and remove the EN language altogether. I ran the pylint process in the file noted above, and added the TODO line as described.

    I cannot seem to get the issue to reproduce. Is there any way one of Igor Novozhilov (@IgorNovozhilov), Don Jayamanne (@DonJayamanne), can get it to repro? Otherwise perhaps this issue has been corrected by something else the team (or the VSCode team) have done.

    BTW: I tried to reproduce this on the following environment, in case it makes a difference:
    OS: Windows 7 Enterprise [RU_ru]
    VSCode: 1.24.0-insider
    Python: 3.6.5
    Node.js: 8.11.1 LTS

    Thanks!
    -Derek Keeler (@d3r3kk)

    EDIT: Added my dev environment

  11. IgorNovozhilov commented on May 15, 2018

    @IgorNovozhilov

    Yes, do not repeated any more. You can close issue.

  12. locked as resolved and limited conversation to collaborators on Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-lintingbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions