Movatterモバイル変換


[0]ホーム

URL:


homepage

Message266062

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Authoreryksun
Recipientsabarry, dstufft, eric.araujo, eryksun, ezio.melotti, martin.panter, paul.moore, r.david.murray, steve.dower, tim.golden, vstinner, zach.ware
Date2016-05-22.09:18:54
SpamBayes Score-1.0
Marked as misclassifiedYes
Message-id<1463908734.71.0.287308006039.issue27048@psf.upfronthosting.co.za>
In-reply-to
Content
When writing to a file or pipe, cmd's internal commands default to either the current codepage of the attached console or, for a detached process, the system locale codepage. It uses a best-fit encoding that tries to map characters to similar characters in the codepage. For example:    >>> win_unicode_console.enable()    >>> os.environ['TEST©'] = '®'    >>> out = subprocess.check_output('cmd /c set test')    >>> out.decode(sys.__stdout__.encoding).strip()    'TESTc=r'You can force it to use Unicode (UTF-16LE) with the /u option:    >>> out = subprocess.check_output('cmd /u /c set test')    >>> out.decode('utf-16le').strip()    'TEST©=®'subprocess could use "/u /c" instead of "/c". This would only affect the output of internal shell commands such as "dir" and "set".
History
DateUserActionArgs
2016-05-22 09:18:54eryksunsetrecipients: +eryksun,paul.moore,vstinner,tim.golden,ezio.melotti,eric.araujo,r.david.murray,martin.panter,zach.ware,steve.dower,dstufft,abarry
2016-05-22 09:18:54eryksunsetmessageid: <1463908734.71.0.287308006039.issue27048@psf.upfronthosting.co.za>
2016-05-22 09:18:54eryksunlinkissue27048 messages
2016-05-22 09:18:54eryksuncreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp