summaryrefslogtreecommitdiffstats
path: root/base/i18n
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 06:05:52 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 06:05:52 +0000
commit79157356c6481b608970379e00cded811e00c003 (patch)
tree489a5ed702fd3092c92be49a523246973c62917c /base/i18n
parent36863701c0c60e0edd2262e3a6f700ef53a82542 (diff)
downloadchromium_src-79157356c6481b608970379e00cded811e00c003.zip
chromium_src-79157356c6481b608970379e00cded811e00c003.tar.gz
chromium_src-79157356c6481b608970379e00cded811e00c003.tar.bz2
Pull in ICU 4.6
Adjust the expected result for the display name of es-419. It does not have 'Carribean Islands' any more in the English display name. Also, swap two parameters of EXPECTED_EQ so that the 1st param is 'expected' and the 2nd is 'actual' in two tests in l10n_util_unittest.cc In addition, change icu_string_conversions.cc to fix the failure of ICUStringConversionsTest.ConvertCodepageUTF8. The test uses WideToCodepage that calls u_strFromWCS. Where U_WCHAR_IS_UTF32 is defined, it calls u_strFromUTF32. On Mac, it's not defined because neither __STDC_ISO_10646__ nor _UCS4_ is defined. As a result, wcstombs is called, which doesn't work as we want it to. There are two ways to fix this: - Directly call u_strFromUTF32 on Mac/Linux. What this CL does. - Manually define U_WCHAR_IS_UTF32 in icu's pmac.h, which is done in http://codereview.chromium.org/6578003 We do both to be block wcs*mbs/mbs*wcs from being called in other parts of ICU when U_WCHAR_IS_UTF32 is not defined. BUG=61514 TEST=Build goes fine and tests pass. Review URL: http://codereview.chromium.org/6532030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/i18n')
-rw-r--r--base/i18n/icu_string_conversions.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/i18n/icu_string_conversions.cc b/base/i18n/icu_string_conversions.cc
index c353feb..6b46537 100644
--- a/base/i18n/icu_string_conversions.cc
+++ b/base/i18n/icu_string_conversions.cc
@@ -221,8 +221,9 @@ bool WideToCodepage(const std::wstring& wide,
// in case each code points translates to a UTF-16 surrogate pair,
// and leave room for a NUL terminator.
std::vector<UChar> utf16(wide.length() * 2 + 1);
- u_strFromWCS(&utf16[0], utf16.size(), &utf16_len,
- wide.c_str(), wide.length(), &status);
+ u_strFromUTF32(&utf16[0], utf16.size(), &utf16_len,
+ reinterpret_cast<const UChar32*>(wide.c_str()),
+ wide.length(), &status);
DCHECK(U_SUCCESS(status)) << "failed to convert wstring to UChar*";
return ConvertFromUTF16(converter, &utf16[0], utf16_len, on_error, encoded);