django-websocket-redis
django-websocket-redis copied to clipboard
validation error in the line containing non-English characters
utf8validator.py", line 129, in validate self.state = Utf8Validator.UTF8VALIDATOR_DFA[256 + (self.state << 4) + Utf8Validator.UTF8VALIDATOR_DFA[ord(ba[i])]] IndexError: list index out of range
Example: ba = {"string":"а"}
I also ancounted such error when sending russian letters through websocket. After observing utf8validator.py I found that by default Utf8Validator of pure Python implementation is used and there is import of Cython implementation of UTF8 validator if available. Which is not installed by default. To fix this we have to install additionally https://pypi.org/project/wsaccel/
try:
from wsaccel.utf8validator import Utf8Validator
except:
## fallback to pure Python implementation
class Utf8Validator: