Skip to content

Commit c5ca29f

Browse files
ktakakurignu-andrew
authored andcommitted
8255239: The timezone of the hs_err_pid log file is corrupted in Japanese locale
Reviewed-by: andrew Backport-of: b46d73bee808af7891b699df30a5a6dec3f5139f
1 parent e403fd5 commit c5ca29f

File tree

1 file changed

+6
-2
lines changed
  • hotspot/src/share/vm/runtime

1 file changed

+6
-2
lines changed

hotspot/src/share/vm/runtime/os.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,12 @@ void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) {
887887

888888
struct tm tz;
889889
if (localtime_pd(&tloc, &tz) != NULL) {
890-
::strftime(buf, buflen, "%Z", &tz);
891-
st->print_cr("timezone: %s", buf);
890+
wchar_t w_buf[80];
891+
size_t n = ::wcsftime(w_buf, 80, L"%Z", &tz);
892+
if (n > 0) {
893+
::wcstombs(buf, w_buf, buflen);
894+
st->print_cr("timezone: %s", buf);
895+
}
892896
}
893897

894898
double t = os::elapsedTime();

0 commit comments

Comments
 (0)