summaryrefslogtreecommitdiffstats
path: root/app/l10n_util.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 20:19:19 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 20:19:19 +0000
commit3ce3e04f248adb3f440493bdae9c303433bc1fc2 (patch)
tree798f13dc156541e4102bae4afa30f839085bee90 /app/l10n_util.cc
parent8279af57b7cffbc823f105b6b1115c15ff25658f (diff)
downloadchromium_src-3ce3e04f248adb3f440493bdae9c303433bc1fc2.zip
chromium_src-3ce3e04f248adb3f440493bdae9c303433bc1fc2.tar.gz
chromium_src-3ce3e04f248adb3f440493bdae9c303433bc1fc2.tar.bz2
Add helper for forcing a GtkEntry to lowercase.
Make l10n_util::ToLower string16 friendly. BUG=13326 Review URL: http://codereview.chromium.org/126260 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util.cc')
-rw-r--r--app/l10n_util.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index 81fb7f4..d51b113 100644
--- a/app/l10n_util.cc
+++ b/app/l10n_util.cc
@@ -476,25 +476,18 @@ std::wstring TruncateString(const std::wstring& string, size_t length) {
#if defined(WCHAR_T_IS_UTF32)
std::wstring ToLower(const std::wstring& string) {
- string16 string_utf16 = WideToUTF16(string);
- UnicodeString lower_u_str(
- UnicodeString(string_utf16.c_str()).toLower(Locale::getDefault()));
- string16 result_utf16;
- lower_u_str.extract(0, lower_u_str.length(),
- WriteInto(&result_utf16, lower_u_str.length() + 1));
- std::wstring result = UTF16ToWide(result_utf16);
- return result;
+ return UTF16ToWide(ToLower(WideToUTF16(string)));
}
-#else
-std::wstring ToLower(const std::wstring& string) {
+#endif // defined(WCHAR_T_IS_UTF32)
+
+string16 ToLower(const string16& string) {
UnicodeString lower_u_str(
UnicodeString(string.c_str()).toLower(Locale::getDefault()));
- std::wstring result;
+ string16 result;
lower_u_str.extract(0, lower_u_str.length(),
WriteInto(&result, lower_u_str.length() + 1));
return result;
}
-#endif // defined(WCHAR_T_IS_UTF32)
// Returns the text direction for the default ICU locale. It is assumed
// that SetICUDefaultLocale has been called to set the default locale to