Skip to content

Commit

Permalink
Merge branch 'master' of github.com:garabik/unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
garabik committed Jan 14, 2016
2 parents a14bb8d + 742ae3a commit bc7040c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Decomposition: 0041 0300



You can specify a range of characters as argumets, unicode will show
You can specify a range of characters as arguments, unicode will show
these characters in nice tabular format, aligned to 256-byte boundaries.
Use two dots ".." to indicate the range, e.g.

Expand Down
7 changes: 4 additions & 3 deletions unicode
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ def do_init():
HomeDir = os.path.expanduser('~/.unicode')
HomeUnicodeData = os.path.join(HomeDir, "UnicodeData.txt")
global UnicodeDataFileNames
UnicodeDataFileNames = [HomeUnicodeData, '/usr/share/unicode/UnicodeData.txt', '/usr/share/unidata/UnicodeData.txt', './UnicodeData.txt'] + \
UnicodeDataFileNames = [HomeUnicodeData, '/usr/share/unicode/UnicodeData.txt', '/usr/share/unicode-data/UnicodeData.txt', '/usr/share/unidata/UnicodeData.txt', './UnicodeData.txt'] + \
glob.glob('/usr/share/unidata/UnicodeData*.txt') + \
glob.glob('/usr/share/perl/*/unicore/UnicodeData.txt') + \
glob.glob('/System/Library/Perl/*/unicore/UnicodeData.txt') # for MacOSX

HomeUnihanData = os.path.join(HomeDir, "Unihan*")
global UnihanDataGlobs
UnihanDataGlobs = [HomeUnihanData, '/usr/share/unidata/Unihan*', '/usr/share/unicode/Unihan*', './Unihan*']
UnihanDataGlobs = [HomeUnihanData, '/usr/share/unidata/Unihan*', '/usr/share/unicode-data/Unihan*', '/usr/share/unicode/Unihan*', './Unihan*']


def get_unihan_files():
Expand Down Expand Up @@ -588,6 +588,7 @@ def print_characters(clist, maxcount, format_string, query_wikipedia=0, query_wi
utf8 = ' '.join([("%02x" % ord23(x)) for x in c.encode('utf-8')])
utf16be = ''.join([("%02x" % ord23(x)) for x in c.encode('utf-16be')])
decimal = "&#%s;" % ordc
octal = "\\0%o" % ordc

addcharset = options.addcharset
if addcharset:
Expand Down Expand Up @@ -726,7 +727,7 @@ def unescape(s):
return s.replace(r'\n', '\n')

format_string_default = '''{yellow}{bold}U+{ordc:04X} {name}{default}
{green}UTF-8:{default} {utf8} {green}UTF-16BE:{default} {utf16be} {green}Decimal:{default} {decimal}{opt_additional}
{green}UTF-8:{default} {utf8} {green}UTF-16BE:{default} {utf16be} {green}Decimal:{default} {decimal} {green}Octal:{default} {octal}{opt_additional}
{pchar}{opt_flipcase}{opt_uppercase}{opt_lowercase}
{green}Category:{default} {category} ({category_desc})
{green}{opt_numeric}{default}{numeric_desc}{green}{opt_digit}{default}{digit_desc}{green}{opt_bidi}{default}{bidi}{bidi_desc}
Expand Down

0 comments on commit bc7040c

Please sign in to comment.