support 8-bit encoding