[Bug #21144] Win32: Convert the time zone name to the current locale
The Windows time zone IDs provided by Microsoft as of 24H1 are ASCII only all, but the API itself is not impossible to set non-ASCII key name. Prefer the current locale encoding for now until we move to UTF-8 including environment variables and command line arguments.
This commit is contained in:
parent
556be73cbb
commit
34098b669c
6
time.c
6
time.c
@ -999,7 +999,13 @@ zone_str(const char *zone)
|
||||
str = rb_usascii_str_new(zone, len);
|
||||
}
|
||||
else {
|
||||
#ifdef _WIN32
|
||||
str = rb_utf8_str_new(zone, len);
|
||||
/* until we move to UTF-8 on Windows completely */
|
||||
str = rb_str_export_locale(str);
|
||||
#else
|
||||
str = rb_enc_str_new(zone, len, rb_locale_encoding());
|
||||
#endif
|
||||
}
|
||||
return rb_fstring(str);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user