MCPcopy Create free account
hub / github.com/apache/datafusion / is_valid_unicode

Function is_valid_unicode

datafusion/pruning/src/pruning_predicate.rs:1965–1979  ·  view source on GitHub ↗

Helper function to check if a character is valid to use

(c: char)

Source from the content-addressed store, hash-verified

1963fn increment_utf8(data: &str) -> Option<String> {
1964 // Helper function to check if a character is valid to use
1965 fn is_valid_unicode(c: char) -> bool {
1966 let cp = c as u32;
1967
1968 // Filter out non-characters (https://www.unicode.org/versions/corrigendum9.html)
1969 if [0xFFFE, 0xFFFF].contains(&cp) || (0xFDD0..=0xFDEF).contains(&cp) {
1970 return false;
1971 }
1972
1973 // Filter out private use area
1974 if cp >= 0x110000 {
1975 return false;
1976 }
1977
1978 true
1979 }
1980
1981 // Convert string to vector of code points
1982 let mut code_points: Vec<char> = data.chars().collect();

Callers 1

increment_utf8Function · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…