prevent null byte[] in case of encoding exc
Merge pull request #311 from emdete/master

prevent null byte[] in case of encoding exc