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

Side by Side Diff: runtime/bin/main.cc

Issue 11558012: Use FormatMessageW for Windows error messages to handle internationalized messages correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years 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 | « runtime/bin/file_win.cc ('k') | runtime/bin/platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_debugger_api.h" 10 #include "include/dart_debugger_api.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 // Convert all the arguments to UTF8. On Windows, the arguments are 251 // Convert all the arguments to UTF8. On Windows, the arguments are
252 // encoded in the current code page and not UTF8. 252 // encoded in the current code page and not UTF8.
253 // 253 //
254 // Returns true if the arguments are converted. In that case 254 // Returns true if the arguments are converted. In that case
255 // each of the arguments need to be deallocated using free. 255 // each of the arguments need to be deallocated using free.
256 static bool Utf8ConvertArgv(int argc, char** argv) { 256 static bool Utf8ConvertArgv(int argc, char** argv) {
257 bool result = false; 257 bool result = false;
258 for (int i = 0; i < argc; i++) { 258 for (int i = 0; i < argc; i++) {
259 char* arg = argv[i]; 259 char* arg = argv[i];
260 argv[i] = StringUtils::SystemStringToUtf8(arg); 260 argv[i] = StringUtils::ConsoleStringToUtf8(arg);
261 if (i == 0) { 261 if (i == 0) {
262 result = argv[i] != arg; 262 result = argv[i] != arg;
263 } else { 263 } else {
264 ASSERT(result == (argv[i] != arg)); 264 ASSERT(result == (argv[i] != arg));
265 } 265 }
266 } 266 }
267 return result; 267 return result;
268 } 268 }
269 269
270 270
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 Dart_ShutdownIsolate(); 789 Dart_ShutdownIsolate();
790 // Terminate process exit-code handler. 790 // Terminate process exit-code handler.
791 Process::TerminateExitCodeHandler(); 791 Process::TerminateExitCodeHandler();
792 // Free copied argument strings if converted. 792 // Free copied argument strings if converted.
793 if (argv_converted) { 793 if (argv_converted) {
794 for (int i = 0; i < argc; i++) free(argv[i]); 794 for (int i = 0; i < argc; i++) free(argv[i]);
795 } 795 }
796 796
797 return 0; 797 return 0;
798 } 798 }
OLDNEW
« no previous file with comments | « runtime/bin/file_win.cc ('k') | runtime/bin/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698