[issue45105] Incorrect handling of unicode character \U00010900

Steven D'Aprano report at bugs.python.org
Sun Sep 5 11:53:23 EDT 2021


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> what's really there when I copy it from Firefox is '0\U0001090000', 
> which matches the result Max gets for individual index operations such as s[1]. 

But *not* the result that Max got from calling list().

Can you reproduce that difference between indexing and list?

Also you say "what's really there", but what is your reasoning for that? 
How do you know that Firefox is displaying the string wrongly, rather 
than displaying it correctly and copying it to the clipboard wrongly?

When I look at the page source of the b.p.o page, I see:

    <pre>I noticed that when using the Unicode character \U00010900 when 
    inserting the character as character:
    Here is the result on the Python console both for 3.6 and 3.9:
    ```
    >>> s = '000X'

again, with X standing in for the Phoenician ALF character. But when I 
copy and paste it into my terminal, I see

    >>> s = '0X00'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45105>
_______________________________________


More information about the Python-bugs-list mailing list