update changelog
some indent corrections
filter invalid utf8 bytes, may have sideeffects
add helper function encodeToJson
update changelog