MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_locale_name

Function check_locale_name

crates/stdlib/src/locale.rs:239–248  ·  view source on GitHub ↗
(locale: &str)

Source from the content-addressed store, hash-verified

237 /// Check if the encoding part of a locale string is too long (Windows only)
238 #[cfg(windows)]
239 fn check_locale_name(locale: &str) -> bool {
240 if let Some(dot_pos) = locale.find('.') {
241 let encoding_part = &locale[dot_pos + 1..];
242 // Find the end of encoding (could be followed by '@' modifier)
243 let encoding_len = encoding_part.find('@').unwrap_or(encoding_part.len());
244 encoding_len <= MAX_CP_LEN
245 } else {
246 true
247 }
248 }
249
250 /// Check locale names for LC_ALL (handles semicolon-separated locales)
251 #[cfg(windows)]

Callers 2

check_locale_name_allFunction · 0.85
setlocaleFunction · 0.85

Calls 2

findMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected