fix ''Struct.chars() not support encoding'' issue