(locale: &str)
| 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)] |
no test coverage detected