packages/lang/python/python-charset-normalizer/test.sh
Jeffery To ddd0f93637 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>
2023-11-02 18:45:45 -07:00

13 lines
292 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
[ "$1" = python3-charset-normalizer ] || exit 0
python3 - << 'EOF'
from charset_normalizer import from_bytes
s = 'Bсеки човек има право на образование.'
byte_str = s.encode('cp1251')
result = from_bytes(byte_str).best()
assert str(result) == s
EOF