add some error checking to utf-8 decoding
add block index for utf8 coded files