Created
March 31, 2021 02:13
-
-
Save crabdancing/54f9acc12b8fef8d247fb2643a4d1cf3 to your computer and use it in GitHub Desktop.
rust winit locale fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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