-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathtest_unicode.py
More file actions
19 lines (16 loc) · 624 Bytes
/
Copy pathtest_unicode.py
File metadata and controls
19 lines (16 loc) · 624 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3
import hyperscan
print(f'hyperscan version: {hyperscan.__version__}')
# Test unicode pattern compilation
patterns = ['السلام عليكم', 'ועליכום הסלאם']
print(f'Testing unicode patterns: {patterns}')
try:
db = hyperscan.Database()
db.compile(expressions=patterns)
print('SUCCESS: Unicode patterns compiled without errors!')
except Exception as e:
print(f'FAILED: {str(e)}')
if 'Expression is not valid UTF-8' in str(e):
print('*** THIS IS THE BUG - the fix is NOT working! ***')
else:
print('*** Different error, not the unicode bug ***')