Convert time zone name to UTF8 on Windows.
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 7 Jun 2011 11:53:49 +0000 (11:53 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 7 Jun 2011 11:53:49 +0000 (11:53 +0000)
R=sgjesse@chromium.org
BUG=v8:1290

Review URL: http://codereview.chromium.org/7125008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/platform-win32.cc

index 75b1365..ed0e430 100644 (file)
@@ -412,13 +412,11 @@ void Time::TzSet() {
   }
 
   // Make standard and DST timezone names.
-  OS::SNPrintF(Vector<char>(std_tz_name_, kTzNameSize),
-               "%S",
-               tzinfo_.StandardName);
+  WideCharToMultiByte(CP_UTF8, 0, tzinfo_.StandardName, -1,
+                      std_tz_name_, kTzNameSize, NULL, NULL);
   std_tz_name_[kTzNameSize - 1] = '\0';
-  OS::SNPrintF(Vector<char>(dst_tz_name_, kTzNameSize),
-               "%S",
-               tzinfo_.DaylightName);
+  WideCharToMultiByte(CP_UTF8, 0, tzinfo_.DaylightName, -1,
+                      dst_tz_name_, kTzNameSize, NULL, NULL);
   dst_tz_name_[kTzNameSize - 1] = '\0';
 
   // If OS returned empty string or resource id (like "@tzres.dll,-211")