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

Unified Diff: runtime/bin/main.cc

Issue 11565008: Use unicode versions of process APIs on Windows. Additionally, (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/process_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 63d00dc5c9ff1790a536c34237342d2c4ee08ea3..de8aa60d9c406f6bfa28901fa36ff8da566d4895 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -254,17 +254,15 @@ static void CloseFile(void* stream) {
// Returns true if the arguments are converted. In that case
// each of the arguments need to be deallocated using free.
static bool Utf8ConvertArgv(int argc, char** argv) {
- bool result = false;
- for (int i = 0; i < argc; i++) {
- char* arg = argv[i];
- argv[i] = StringUtils::ConsoleStringToUtf8(arg);
- if (i == 0) {
- result = argv[i] != arg;
- } else {
- ASSERT(result == (argv[i] != arg));
- }
- }
- return result;
+ int unicode_argc = 0;
+ wchar_t** unicode_argv = ShellUtils::GetUnicodeArgv(&unicode_argc);
+ if (unicode_argv == NULL) return false;
+ for (int i = 0; i < unicode_argc; i++) {
+ wchar_t* arg = unicode_argv[i];
+ argv[i] = StringUtils::WideToUtf8(arg);
+ }
+ ShellUtils::FreeUnicodeArgv(unicode_argv);
+ return true;
}
« no previous file with comments | « no previous file | runtime/bin/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698