Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: src/platform-win32.cc

Issue 7125008: Convert time zone name to UTF8 on Windows. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 tzinfo_.StandardDate.wDay = 5; 405 tzinfo_.StandardDate.wDay = 5;
406 tzinfo_.StandardDate.wHour = 3; 406 tzinfo_.StandardDate.wHour = 3;
407 tzinfo_.StandardBias = 0; 407 tzinfo_.StandardBias = 0;
408 tzinfo_.DaylightDate.wMonth = 3; 408 tzinfo_.DaylightDate.wMonth = 3;
409 tzinfo_.DaylightDate.wDay = 5; 409 tzinfo_.DaylightDate.wDay = 5;
410 tzinfo_.DaylightDate.wHour = 2; 410 tzinfo_.DaylightDate.wHour = 2;
411 tzinfo_.DaylightBias = -60; 411 tzinfo_.DaylightBias = -60;
412 } 412 }
413 413
414 // Make standard and DST timezone names. 414 // Make standard and DST timezone names.
415 OS::SNPrintF(Vector<char>(std_tz_name_, kTzNameSize), 415 WideCharToMultiByte(CP_UTF8, 0, tzinfo_.StandardName, -1,
416 "%S", 416 std_tz_name_, kTzNameSize, NULL, NULL);
417 tzinfo_.StandardName);
418 std_tz_name_[kTzNameSize - 1] = '\0'; 417 std_tz_name_[kTzNameSize - 1] = '\0';
419 OS::SNPrintF(Vector<char>(dst_tz_name_, kTzNameSize), 418 WideCharToMultiByte(CP_UTF8, 0, tzinfo_.DaylightName, -1,
420 "%S", 419 dst_tz_name_, kTzNameSize, NULL, NULL);
421 tzinfo_.DaylightName);
422 dst_tz_name_[kTzNameSize - 1] = '\0'; 420 dst_tz_name_[kTzNameSize - 1] = '\0';
423 421
424 // If OS returned empty string or resource id (like "@tzres.dll,-211") 422 // If OS returned empty string or resource id (like "@tzres.dll,-211")
425 // simply guess the name from the UTC bias of the timezone. 423 // simply guess the name from the UTC bias of the timezone.
426 // To properly resolve the resource identifier requires a library load, 424 // To properly resolve the resource identifier requires a library load,
427 // which is not possible in a sandbox. 425 // which is not possible in a sandbox.
428 if (std_tz_name_[0] == '\0' || std_tz_name_[0] == '@') { 426 if (std_tz_name_[0] == '\0' || std_tz_name_[0] == '@') {
429 OS::SNPrintF(Vector<char>(std_tz_name_, kTzNameSize - 1), 427 OS::SNPrintF(Vector<char>(std_tz_name_, kTzNameSize - 1),
430 "%s Standard Time", 428 "%s Standard Time",
431 GuessTimezoneNameFromBias(tzinfo_.Bias)); 429 GuessTimezoneNameFromBias(tzinfo_.Bias));
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 2014
2017 void Sampler::Stop() { 2015 void Sampler::Stop() {
2018 ASSERT(IsActive()); 2016 ASSERT(IsActive());
2019 SamplerThread::RemoveActiveSampler(this); 2017 SamplerThread::RemoveActiveSampler(this);
2020 SetActive(false); 2018 SetActive(false);
2021 } 2019 }
2022 2020
2023 #endif // ENABLE_LOGGING_AND_PROFILING 2021 #endif // ENABLE_LOGGING_AND_PROFILING
2024 2022
2025 } } // namespace v8::internal 2023 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698