diff options
Diffstat (limited to 'chromium/base/strings/utf_string_conversions.h')
-rw-r--r-- | chromium/base/strings/utf_string_conversions.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chromium/base/strings/utf_string_conversions.h b/chromium/base/strings/utf_string_conversions.h index f780fb4f4f8..9ee91453a02 100644 --- a/chromium/base/strings/utf_string_conversions.h +++ b/chromium/base/strings/utf_string_conversions.h @@ -12,6 +12,7 @@ #include "base/base_export.h" #include "base/strings/string16.h" #include "base/strings/string_piece.h" +#include "build/build_config.h" namespace base { @@ -49,6 +50,16 @@ BASE_EXPORT string16 ASCIIToUTF16(StringPiece ascii) WARN_UNUSED_RESULT; // beforehand. BASE_EXPORT std::string UTF16ToASCII(StringPiece16 utf16) WARN_UNUSED_RESULT; +#if defined(WCHAR_T_IS_UTF16) +// This converts an ASCII string, typically a hardcoded constant, to a wide +// string. +BASE_EXPORT std::wstring ASCIIToWide(StringPiece ascii) WARN_UNUSED_RESULT; + +// Converts to 7-bit ASCII by truncating. The result must be known to be ASCII +// beforehand. +BASE_EXPORT std::string WideToASCII(WStringPiece wide) WARN_UNUSED_RESULT; +#endif // defined(WCHAR_T_IS_UTF16) + } // namespace base #endif // BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ |