Meta: Disallow emoji images with invalid code points in their file name

This commit is contained in:
Timothy Flynn 2022-10-26 12:53:07 -04:00 committed by Linus Groh
parent 23afb59a3d
commit 006118599c
Notes: sideshowbarker 2024-07-17 05:05:29 +09:00

View File

@ -52,6 +52,13 @@ def any_problems_here():
found_invalid_filenames = True
break
code_points = [int(code_point[len('U+'):], 16) for code_point in filename.split('_')]
if any(code_point > 0x10ffff for code_point in code_points):
print(f'Filename {filename}.png contains a code point exceeding U+10FFFF')
found_invalid_filenames = True
break
return found_invalid_filenames