Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unicode character widths
#2
import wcwidth


symbols = [
    '\N{ZERO WIDTH SPACE}',
    '\N{NARROW NO-BREAK SPACE}',
    '\N{MEDIUM MATHEMATICAL SPACE}',
    '\N{IDEOGRAPHIC SPACE}'
    ]
for symbol in symbols:
    print(symbol, wcwidth.wcwidth(symbol))
Output:
0   1   1   2
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
Unicode character widths - by Skaperen - Apr-15-2019, 02:30 AM
RE: Unicode character widths - by DeaD_EyE - Apr-15-2019, 08:21 AM
RE: Unicode character widths - by Skaperen - Apr-16-2019, 05:11 AM
RE: Unicode character widths - by DeaD_EyE - Apr-16-2019, 08:09 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020