added option to get first invalid byte which is suitable for cropping only utf-8 part of string