charset.py: fix NameError