[WIP] fixes qp encoder & non-utf8 charset bug

Fixes #288