Closed abalakh closed 6 years ago
Work would have to be done to the unicode_letters_generator
method and the ranges for BMP
and SMP
can be found here: https://en.wikipedia.org/wiki/Plane_(Unicode)
@abalakh here's what I'm thinking:
import unicodedata
from collections import namedtuple
UnicodePlane = namedtuple('UnicodePlane', ['min', 'max'])
BMP = UnicodePlane(int('0x0000', 16), int('0xffff', 16))
SMP = UnicodePlane(int('0x10000', 16), int('0x1ffff', 16))
def unicode_letters_generator(smp=True):
"""Generate unicode characters in the letters category.
:param bool smp: Include Supplementary Multilingual Plane (SMP)
characters
:return: a generator which will generates all unicode letters available
"""
for i in range(BMP.min, SMP.max if smp else BMP.max):
char = chr(i)
if unicodedata.category(char).startswith('L'):
yield char
Thoughts?
Resolved by #96
Chromedriver only supports BMP chars and can't type SMP. Can we have option, or at least arg for gen_***() funcs to generate BMP only? 🙂