Update encoding.py

Little bugfix