Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with DOS/Windows encoding #556

Closed
spyder-bot opened this issue Feb 16, 2015 · 5 comments
Closed

Deal with DOS/Windows encoding #556

spyder-bot opened this issue Feb 16, 2015 · 5 comments

Comments

@spyder-bot
Copy link
Collaborator

From sherdim on 2011-02-11T16:13:01Z

What steps will reproduce the problem?

  1. Run DOS command in IPython eg: !dir
    1. CMD window flashes (another issue) and stdout returned in the console with text in locale
    2. Output in ASCII? encoding, not Windows locale

The reason is default Russian DOS and Windows are different, 866 and 1251, respectively
Spyder assume UTF-8 as default, but in the console don't care about it
Usual IPython "DOS" console "knows" it, and %print magic deals with encodings

==Unicode==
In [56]: s=u'мамa'

In [57]: s
Out[57]: u'\u043c\u0430\u043ca'

In [58]: p s
мамa

==Default text==
In [59]: s='мамa'

In [60]: s
Out[60]: '\xd0\xbc\xd0\xb0\xd0\xbca'

In [61]: p s
мамa

What is the expected output?
the same as input

=cf. In the "DOS" IPython=
In [3]: s='мама'

In [4]: s
Out[4]: '\xac\xa0\xac\xa0'

In [5]: p s
мама

In [1]: s=u"мама"

In [2]: s
Out[2]: u'\xac\xa0\xac\xa0'

In [3]: p s
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid

In [10]: p s.encode('1251')
мама

Spyder 2.0.6, Windows Vista

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=556

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2011-02-22T01:05:25Z

Regarding the flashing command window issue, see this: https://code.google.com/p/spyderlib/issues/detail?id=423 I'll get back later to the main issue here.
Thanks for taking the time to give feedback.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2011-05-16T01:27:58Z

Labels: Cat-Console

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-10-12T14:25:08Z

Labels: MS-v2.3.2

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-10-12T17:14:49Z

This is not an issue anymore for IPython but it is for our Python consoles

Status: Accepted

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-10-26T10:04:58Z

This issue was closed by revision e47a69abbc85 .

Status: Fixed

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

No branches or pull requests

1 participant