Issue #8 Fix encoding problem properly