| @@ -248,7 +248,7 @@ int main(int argc, char **argv) | |||
| else | |||
| { | |||
| for (codepoint_t c = 0; c <= 0x10FFFF; ++c) | |||
| uprintf(stdout, c, format ? format : "%pH %s %C %c %UH %LH %TH %is %iu %il\n"); | |||
| uprintf(stdout, c, format ? format : "%pH %s %C %c %UH %LH %TH %id %ix %is %iu %il\n"); | |||
| } | |||
| return 0; | |||
| } | |||
| @@ -243,7 +243,7 @@ int main(int argc, char **argv) | |||
| else | |||
| { | |||
| for (codepoint_t c = 0; c <= 0x10FFFF; ++c) | |||
| uprintf(stdout, c, format ? format : "%pH %s %C %c %UH %LH %TH %is %iu %il\n"); | |||
| uprintf(stdout, c, format ? format : "%pH %s %C %c %UH %LH %TH %id %ix %is %iu %il\n"); | |||
| } | |||
| return 0; | |||
| } | |||
| @@ -243,7 +243,7 @@ int main(int argc, char **argv) | |||
| else | |||
| { | |||
| for (ucd::codepoint_t c = 0; c <= 0x10FFFF; ++c) | |||
| uprintf(stdout, c, format ? format : "%pH %s %C %c %UH %LH %TH %is %iu %il\n"); | |||
| uprintf(stdout, c, format ? format : "%pH %s %C %c %UH %LH %TH %id %ix %is %iu %il\n"); | |||
| } | |||
| return 0; | |||
| } | |||
| @@ -43,6 +43,12 @@ if '--with-csur' in sys.argv: | |||
| for codepoint in data['CodePoint']: | |||
| unicode_chars[codepoint] = data | |||
| def isdigit(data): | |||
| return 1 if data['CodePoint'].char() in '0123456789' else 0 | |||
| def isxdigit(data): | |||
| return 1 if data['CodePoint'].char() in '0123456789ABCDEFabcdef' else 0 | |||
| def isspace(data): | |||
| return data.get('White_Space', 0) | |||
| @@ -67,7 +73,7 @@ if __name__ == '__main__': | |||
| try: | |||
| data = unicode_chars[codepoint] | |||
| except KeyError: | |||
| data = {} | |||
| data = {'CodePoint': codepoint} | |||
| script = data.get('Script', 'Zzzz') | |||
| title = data.get('TitleCase', codepoint) | |||
| upper = data.get('UpperCase', codepoint) | |||
| @@ -75,9 +81,10 @@ if __name__ == '__main__': | |||
| if title == null: title = codepoint | |||
| if upper == null: upper = codepoint | |||
| if lower == null: lower = codepoint | |||
| print('%s %s %s %s %s %s %s %s %s %s' % ( | |||
| print('%s %s %s %s %s %s %s %s %s %s %s %s' % ( | |||
| codepoint, script, | |||
| data.get('GeneralCategory', 'Cn')[0], data.get('GeneralCategory', 'Cn'), | |||
| upper, lower, title, | |||
| isdigit(data), isxdigit(data), | |||
| isspace(data), | |||
| isupper(data), islower(data))) | |||
| @@ -50,6 +50,9 @@ class CodePoint: | |||
| def __lt__(self, other): | |||
| return self.codepoint < other.codepoint | |||
| def char(self): | |||
| return unichr(self.codepoint) | |||
| class CodeRange: | |||
| def __init__(self, x): | |||
| f, l = x.split('..') | |||
| @@ -69,6 +72,9 @@ class CodeRange: | |||
| def size(self): | |||
| return self.last.codepoint - self.first.codepoint + 1 | |||
| def char(self): | |||
| return unichr(self.first.codepoint) | |||
| def codepoint(x): | |||
| if '..' in x[0]: | |||
| return CodeRange(x[0]), x[1:] | |||