rawEncode should be used instead of encode