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

Unified Diff: base/command_line.cc

Issue 174139: Fix Issue 19689: Command line URL parameter does not support Chinese.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line.cc
===================================================================
--- base/command_line.cc (revision 24387)
+++ base/command_line.cc (working copy)
@@ -127,7 +127,7 @@
}
CommandLine::CommandLine(const std::wstring& program) {
- argv_.push_back(WideToASCII(program));
+ argv_.push_back(base::SysWideToNativeMB(program));
}
#endif
@@ -224,7 +224,7 @@
#if defined(OS_WIN)
return result->second;
#else
- return ASCIIToWide(result->second);
+ return base::SysNativeMBToWide(result->second);
#endif
}
}
@@ -240,12 +240,12 @@
std::vector<std::wstring> CommandLine::GetLooseValues() const {
std::vector<std::wstring> values;
for (size_t i = 0; i < loose_values_.size(); ++i)
- values.push_back(ASCIIToWide(loose_values_[i]));
+ values.push_back(base::SysNativeMBToWide(loose_values_[i]));
return values;
}
std::wstring CommandLine::program() const {
DCHECK(argv_.size() > 0);
- return ASCIIToWide(argv_[0]);
+ return base::SysNativeMBToWide(argv_[0]);
}
#endif
@@ -341,15 +341,15 @@
void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string,
const std::wstring& value_string) {
std::string ascii_switch = WideToASCII(switch_string);
- std::string ascii_value = WideToASCII(value_string);
+ std::string mb_value = base::SysWideToNativeMB(value_string);
argv_.push_back(kSwitchPrefixes[0] + ascii_switch +
- kSwitchValueSeparator + ascii_value);
- switches_[ascii_switch] = ascii_value;
+ kSwitchValueSeparator + mb_value);
+ switches_[ascii_switch] = mb_value;
}
void CommandLine::AppendLooseValue(const std::wstring& value) {
- argv_.push_back(WideToASCII(value));
+ argv_.push_back(base::SysWideToNativeMB(value));
}
void CommandLine::AppendArguments(const CommandLine& other,
@@ -369,7 +369,7 @@
void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) {
// The wrapper may have embedded arguments (like "gdb --args"). In this case,
// we don't pretend to do anything fancy, we just split on spaces.
- const std::string wrapper = WideToASCII(wrapper_wide);
+ const std::string wrapper = base::SysWideToNativeMB(wrapper_wide);
std::vector<std::string> wrapper_and_args;
SplitString(wrapper, ' ', &wrapper_and_args);
argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end());
« no previous file with comments | « no previous file | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698