fix #4: segfault when no encoding detected

caused by trying to wrap 0 as a Python string