summaryrefslogtreecommitdiffstats
path: root/base/string_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/string_util.cc')
-rw-r--r--base/string_util.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/base/string_util.cc b/base/string_util.cc
index 91a1c4c..efc15f3 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -415,16 +415,20 @@ bool ContainsOnlyChars(const std::string& input,
return ContainsOnlyCharsT(input, characters);
}
+namespace base {
+
std::string WideToASCII(const std::wstring& wide) {
- DCHECK(IsStringASCII(wide)) << wide;
+ DCHECK(IsStringASCII(wide)) << WideToUTF8(wide);
return std::string(wide.begin(), wide.end());
}
std::string UTF16ToASCII(const string16& utf16) {
- DCHECK(IsStringASCII(utf16)) << utf16;
+ DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16);
return std::string(utf16.begin(), utf16.end());
}
+} // namespace base
+
// Latin1 is just the low range of Unicode, so we can copy directly to convert.
bool WideToLatin1(const std::wstring& wide, std::string* latin1) {
std::string output;