We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04fcf60 commit a5d5b60Copy full SHA for a5d5b60
datafusion/functions/src/string/chr.rs
@@ -207,6 +207,16 @@ mod tests {
207
"requested character too large for encoding"
208
);
209
210
+ // invalid Unicode code points (surrogate code point)
211
+ // link: <https://learn.microsoft.com/en-us/globalization/encoding/unicode-standard#surrogate-pairs>
212
+ let input = Arc::new(Int64Array::from(vec![0xD800 + 1]));
213
+ let result = chr(&[input]);
214
+ assert!(result.is_err());
215
+ assert_contains!(
216
+ result.err().unwrap().to_string(),
217
+ "requested character too large for encoding"
218
+ );
219
+
220
// negative input
221
let input = Arc::new(Int64Array::from(vec![i64::MIN + 2i64])); // will be 2 if cast to u32
222
let result = chr(&[input]);
0 commit comments