Skip to main content

normalize_raw_locale

Function normalize_raw_locale 

Source
pub fn normalize_raw_locale(raw: &str) -> String
Expand description

Normalizes a raw locale string for BCP47 parse.

  • Strips encoding suffix (.UTF-8, .utf8)
  • Strips @modifier (e.g. @euro)
  • Converts _ separators to -
  • Trims whitespace

Does not treat C / POSIX / C.UTF-8 as English — those parse as invalid/unsupported and fall through negotiation.