Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

unicodedata.east_asian_width returns wrong result for unassigned Unicode code points #96172

Closed
Labels
@cfbolz

Description

@cfbolz

This is really a corner case, but I ran across the problem today. The unicode data file foreast asian widths states:

#  - All code points, assigned or unassigned, that are not listed#      explicitly are given the value "N".

However, that seems to not be true in theunicodedata module, eg:

$python3Python3.10.4 (main,Jun292022,12:14:53) [GCC11.2.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>importunicodedata>>>char=chr(0xfe75)# arbitrary unassigned code point>>>unicodedata.name(char)Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>ValueError:nosuchname>>>unicodedata.east_asian_width(char)'F'

I'd be happy to fix this, if people agree that it should be fixed. FWIW, PyPy has always returned 'N' in this situation. For assigned code points everything is fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp