Skip to content

console w/ cp65001 displays extra characters for non-ascii strings. #58435

Closed

Description

@metolone
mannequin
BPO 14227
Nosy @loewis, @vstinner, @ezio-melotti

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-04-05.11:46:33.574>
created_at = <Date 2012-03-08.04:35:32.666>
labels = ['expert-unicode', 'type-bug', 'expert-IO', 'OS-windows']
title = 'console w/ cp65001 displays extra characters for non-ascii strings.'
updated_at = <Date 2012-04-05.11:46:33.573>
user = 'https://bugs.python.org/metolone'

bugs.python.org fields:

activity = <Date 2012-04-05.11:46:33.573>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2012-04-05.11:46:33.574>
closer = 'vstinner'
components = ['Unicode', 'Windows', 'IO']
creation = <Date 2012-03-08.04:35:32.666>
creator = 'metolone'
dependencies = []
files = []
hgrepos = []
issue_num = 14227
keywords = []
message_count = 3.0
messages = ['155149', '155158', '157568']
nosy_count = 4.0
nosy_names = ['loewis', 'vstinner', 'ezio.melotti', 'metolone']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue14227'
versions = ['Python 3.3']

Activity

  1. metolone commented on Mar 8, 2012

    metolonemannequin
    MannequinAuthor

    This is on Windows 7 SP1. Run 'chcp 65001' then Python from a console. Note the extra characters when non-ASCII characters are in the string. At a guess it appears to be using the UTF-8 byte length of the internal representation instead of the character count.

    Python 3.3.0a1 (default, Mar  4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> print('hello')
    hello
    >>> print('p\u012bny\u012bn')
    pīnyīn
    n
    >>> print('\u012b'*10)
    īīīīīīīīīī
    �īīīī
    �ī
  2. vstinner commented on Mar 8, 2012

    @vstinner
    Member

    See the issue bpo-1602.

  3. vstinner commented on Apr 5, 2012

    @vstinner
    Member

    I'm quite sure that this issue is a duplicate of bpo-1602.

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions