From 9de899cc3ffd3aa3f8f827201cbe14120609018b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 12 Apr 2010 18:32:50 -0700 Subject: Fix String.toLowerCase and toUpperCase. Rather than try to cope with Lithuanian, let's just hand that one to ICU4C. I've removed my hand-crafted Azeri/Turkish lowercasing too, in favor of ICU. Presence of a high surrogate (which implies a supplemental character) is a good reason to hand over to ICU too. On the uppercasing side, I've kept our existing hard-coded table and just added code to defer to ICU for Azeri, Lithuanian, and Turkish (plus supplemental characters). I don't like the tables, but I don't have proof that they're incorrect. Bug: 2340628 Change-Id: I36b556b0444623a5aacc1afc58ebb4d84211d3dc --- icu/src/main/native/ScopedJavaUnicodeString.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'icu/src/main/native/ScopedJavaUnicodeString.h') diff --git a/icu/src/main/native/ScopedJavaUnicodeString.h b/icu/src/main/native/ScopedJavaUnicodeString.h index 69726fb..b108a6b 100644 --- a/icu/src/main/native/ScopedJavaUnicodeString.h +++ b/icu/src/main/native/ScopedJavaUnicodeString.h @@ -22,9 +22,7 @@ // A smart pointer that provides access to an ICU UnicodeString given a JNI // jstring. We give ICU a direct pointer to the characters on the Java heap. -// It's clever enough to copy-on-write if necessary, but we only provide -// const UnicodeString access anyway because attempted write access seems -// likely to be an error. +// It's clever enough to copy-on-write if necessary. class ScopedJavaUnicodeString { public: ScopedJavaUnicodeString(JNIEnv* env, jstring s) : mEnv(env), mString(s) { @@ -37,7 +35,11 @@ public: mEnv->ReleaseStringChars(mString, mChars); } - const UnicodeString& unicodeString() { + const UnicodeString& unicodeString() const { + return mUnicodeString; + } + + UnicodeString& unicodeString() { return mUnicodeString; } -- cgit v1.1