Are the Windows NLS API Locale Information Constants available anywhere in the winapi-rs crate or elsewhere in the Rust ecosystem?
I need to call GetLocaleInformationEx from Rust and have found it available in the um::winnls module of the winapi-rs crate (here).
The LCType input is a Locale Information Constant -- and I have not been able to find these defined anywhere in the crate.
As a workaround, I have looked up the numerical values and hard-coded them, but I have a nagging feeling that I am missing something.
This is a late answer, but since other people can have this issue as well, so I'll still write my solution:
While the winapi crate doesn't contain all locale information constants, the windows-sys crate does.
On this Microsoft site there is a list of all available Locale information constants. These are also available as constants in windows_sys::Win32::Globalization, see here.
If you want to use winapi instead of windows-sys, I'd advice to just look up the value of the respective locale there and define your own constant in your Rust code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With