Skip to content

Instantly share code, notes, and snippets.

@crabdancing
Created March 31, 2021 02:13
Show Gist options
  • Save crabdancing/54f9acc12b8fef8d247fb2643a4d1cf3 to your computer and use it in GitHub Desktop.
Save crabdancing/54f9acc12b8fef8d247fb2643a4d1cf3 to your computer and use it in GitHub Desktop.
rust winit locale fix
// On Amethyst, winit glitches out when you create the window if you're using nonstandard locale settings
// Here's a function I made to fix that issue
fn fix_winit_bug() {
let var_names = [ "LANG",
"LC_CTYPE", "LC_NUMERIC", "LC_TIME",
"LC_COLLATE", "LC_MONETARY", "LC_MESSAGES",
"LC_PAPER", "LC_NAME", "LC_ADDRESS",
"LC_TELEPHONE", "LC_MEASUREMENT", "LC_IDENTIFICATION" ];
for var_name in &var_names {
std::env::set_var(var_name, "C.utf8");
}
std::env::set_var("LC_ALL", "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment