fix multibyte handling