Fix charbuf encoding in py3. Fixes #13.