[Bug 4922] New: Output stream encoding is not honored

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Tue Oct 27 16:25:52 UTC 2015


https://bz.mercurial-scm.org/show_bug.cgi?id=4922

            Bug ID: 4922
           Summary: Output stream encoding is not honored
           Product: Mercurial
           Version: 3.4.2
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: ivan_pozdeev at mail.ru
                CC: mercurial-devel at selenic.com

When `sys.stdout.encoding'/`sys.stderr.encoding' is set and differs from
`locale.getpreferredencoding()', hg uses the latter which results in unreadable
output.

Specifically, in cmd.exe session in Windows, ANSI rather than OEM encoding is
used.

The proposed design change is to move the encoding operation from
`mercurial.i18n.gettext()' to the actual printing (`mercurial.ui'), with stream
encoding, if set, overriding the default.

I'm not sure about cases with stream encoding set to `ascii' or
`ANSI_X3.4-1968' (which appears to be its alias in newer versions) - i.e. an
encoding with lesser capacity.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list