#! /usr/bin/python3

"""Prints the Unicode code points and names for arguments.
Usage: uwhois <some string>
"""

import unicodedata
import sys

if len(sys.argv) == 1:
    print(__doc__.replace('uwhois', sys.argv[0]))
else:
    if sys.argv[1:] == ['-']:
        words = sys.stdin
    else:
        words = sys.argv[1:]
    for word in words:
        for letter in word:
            try:
                display, name = letter, unicodedata.name(letter)
            except ValueError:
                display, name = ' ', repr(letter)
            nfd = unicodedata.normalize('NFD', letter)
            if nfd != letter:
               extra = "(NFD: %s)" % ', '.join('U+%04X %s' % (ord(c), unicodedata.name(c)) for c in nfd)
            else:
               extra = ''
            print('U+%04X' % ord(letter), display, '(' + unicodedata.category(letter) + '):', name, extra)
        print()

c14501cd26fc004e93107a9ced7db3b25a00a5e5
<mask token>

<mask token>
if len(sys.argv) == 1:
    print(__doc__.replace('uwhois', sys.argv[0]))
else:
    if sys.argv[1:] == ['-']:
        words = sys.stdin
    else:
        words = sys.argv[1:]
    for word in words:
        for letter in word:
            try:
                display, name = letter, unicodedata.name(letter)
            except ValueError:
                display, name = ' ', repr(letter)
            nfd = unicodedata.normalize('NFD', letter)
            if nfd != letter:
                extra = '(NFD: %s)' % ', '.join('U+%04X %s' % (ord(c),
                    unicodedata.name(c)) for c in nfd)
            else:
                extra = ''
            print('U+%04X' % ord(letter), display, '(' + unicodedata.
                category(letter) + '):', name, extra)
        print()

<mask token>
import unicodedata
import sys
if len(sys.argv) == 1:
    print(__doc__.replace('uwhois', sys.argv[0]))
else:
    if sys.argv[1:] == ['-']:
        words = sys.stdin
    else:
        words = sys.argv[1:]
    for word in words:
        for letter in word:
            try:
                display, name = letter, unicodedata.name(letter)
            except ValueError:
                display, name = ' ', repr(letter)
            nfd = unicodedata.normalize('NFD', letter)
            if nfd != letter:
                extra = '(NFD: %s)' % ', '.join('U+%04X %s' % (ord(c),
                    unicodedata.name(c)) for c in nfd)
            else:
                extra = ''
            print('U+%04X' % ord(letter), display, '(' + unicodedata.
                category(letter) + '):', name, extra)
        print()

#! /usr/bin/python3

"""Prints the Unicode code points and names for arguments.
Usage: uwhois <some string>
"""

import unicodedata
import sys

if len(sys.argv) == 1:
    print(__doc__.replace('uwhois', sys.argv[0]))
else:
    if sys.argv[1:] == ['-']:
        words = sys.stdin
    else:
        words = sys.argv[1:]
    for word in words:
        for letter in word:
            try:
                display, name = letter, unicodedata.name(letter)
            except ValueError:
                display, name = ' ', repr(letter)
            nfd = unicodedata.normalize('NFD', letter)
            if nfd != letter:
               extra = "(NFD: %s)" % ', '.join('U+%04X %s' % (ord(c), unicodedata.name(c)) for c in nfd)
            else:
               extra = ''
            print('U+%04X' % ord(letter), display, '(' + unicodedata.category(letter) + '):', name, extra)
        print()
