From f05c4957883241f49956d594323270db10b72a14 Mon Sep 17 00:00:00 2001 From: "jshin@chromium.org" Date: Mon, 7 Jun 2010 23:23:07 +0000 Subject: Make SysNativeMB converters assume UTF-8 on Chrome OS. Instead of using wcs*mbs and mbs*wcs, just call UTF-8 converters. BUG=39096 TEST=Covered by existing tests Review URL: http://codereview.chromium.org/1222002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49118 0039d316-1c4b-4281-b951-d872f2087c98 --- base/sys_string_conversions_linux.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'base') diff --git a/base/sys_string_conversions_linux.cc b/base/sys_string_conversions_linux.cc index 26bc78b..6a6eac9 100644 --- a/base/sys_string_conversions_linux.cc +++ b/base/sys_string_conversions_linux.cc @@ -24,6 +24,19 @@ std::wstring SysUTF8ToWide(const StringPiece& utf8) { return out; } +#if defined(OS_CHROMEOS) + +// ChromeOS always runs in UTF-8 locale. +std::string SysWideToNativeMB(const std::wstring& wide) { + return WideToUTF8(wide); +} + +std::wstring SysNativeMBToWide(const StringPiece& native_mb) { + return SysUTF8ToWide(native_mb); +} + +#else + std::string SysWideToNativeMB(const std::wstring& wide) { mbstate_t ps; @@ -141,4 +154,6 @@ std::wstring SysNativeMBToWide(const StringPiece& native_mb) { return out; } +#endif // OS_CHROMEOS + } // namespace base -- cgit v1.1