Fixes qp encoder & non-utf8 charset bug

Fixes #288 & shoulf fix #315 (to be confirmed)