Fix writeChar and writeUChar (reuse the format of readChar and readUChar)