python-charset-normalizer: Update to 3.3.2

This also updates the test.sh script to use an assert.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2023-10-30 19:28:50 +08:00
committed by Rosen Penev
parent db9202ccc5
commit ddd0f93637
2 changed files with 6 additions and 5 deletions

View File

@@ -2,11 +2,12 @@
[ "$1" = python3-charset-normalizer ] || exit 0
python3 - << EOF
import sys
python3 - << 'EOF'
from charset_normalizer import from_bytes
s = 'Bсеки човек има право на образование.'
byte_str = s.encode('cp1251')
result = from_bytes(byte_str).best()
sys.exit(0 if str(result) == s else 1)
assert str(result) == s
EOF