fix for "invalid byte sequence in UTF-8"

This fixed the problem for me, so though i push this.