Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2012-10-25 12:21:33 +0000
committerDani Megert2012-10-25 12:21:33 +0000
commit6d8d25ceafc477087e85ed3340bddf46ef92bc80 (patch)
tree88f66b65a581f02a218ea67c2f490e34cd9795cb
parentd0aa183bc9717b7490f75a28fffeb46b3bf4625f (diff)
downloadeclipse.platform.text-6d8d25ceafc477087e85ed3340bddf46ef92bc80.tar.gz
eclipse.platform.text-6d8d25ceafc477087e85ed3340bddf46ef92bc80.tar.xz
eclipse.platform.text-6d8d25ceafc477087e85ed3340bddf46ef92bc80.zip
between doted I and dotless I in Turkish.
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/PatternConstructor.java8
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java19
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java6
3 files changed, 26 insertions, 7 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/PatternConstructor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/PatternConstructor.java
index 686080334..7e94adecc 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/PatternConstructor.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/PatternConstructor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -491,11 +491,11 @@ public class PatternConstructor {
*/
private void interpretRetainCase(StringBuffer buf, char ch) {
if (fRetainCaseMode == RC_UPPER)
- buf.append(Character.toUpperCase(ch));
+ buf.append(String.valueOf(ch).toUpperCase());
else if (fRetainCaseMode == RC_LOWER)
- buf.append(Character.toLowerCase(ch));
+ buf.append(String.valueOf(ch).toLowerCase());
else if (fRetainCaseMode == RC_FIRSTUPPER) {
- buf.append(Character.toUpperCase(ch));
+ buf.append(String.valueOf(ch).toUpperCase());
fRetainCaseMode= RC_MIXED;
} else
buf.append(ch);
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java
index 89a4886fd..24fac328f 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java
@@ -13,6 +13,7 @@
package org.eclipse.text.tests;
import java.util.Arrays;
+import java.util.Locale;
import java.util.regex.PatternSyntaxException;
import junit.framework.Assert;
@@ -311,6 +312,24 @@ public class FindReplaceDocumentAdapterTest extends TestCase {
fDocument.set("FOO");
regexReplace("FOO", "xyz\\Cna\\u00EFve\\xFF", findReplaceDocumentAdapter);
assertEquals("xyzNA\u00CFVE\u0178", fDocument.get());
+
+ fDocument.set("A");
+ regexReplace("A", "\\Ci", findReplaceDocumentAdapter);
+ assertEquals("I", fDocument.get());
+
+ Locale currentLocale= Locale.getDefault();
+ try {
+ Locale.setDefault(new Locale("tr"));
+ fDocument.set("A");
+ regexReplace("A", "\\Ci", findReplaceDocumentAdapter);
+ assertEquals("\u0130", fDocument.get());
+
+ fDocument.set("a");
+ regexReplace("a", "\\CI", findReplaceDocumentAdapter);
+ assertEquals("\u0131", fDocument.get());
+ } finally {
+ Locale.setDefault(currentLocale);
+ }
}
private void regexReplace(String find, String replace, FindReplaceDocumentAdapter findReplaceDocumentAdapter) throws BadLocationException {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java b/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java
index 40bdd17a8..8ec45f3b1 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java
@@ -349,11 +349,11 @@ public class FindReplaceDocumentAdapter implements CharSequence {
*/
private void interpretRetainCase(StringBuffer buf, char ch) {
if (fRetainCaseMode == RC_UPPER)
- buf.append(Character.toUpperCase(ch));
+ buf.append(String.valueOf(ch).toUpperCase());
else if (fRetainCaseMode == RC_LOWER)
- buf.append(Character.toLowerCase(ch));
+ buf.append(String.valueOf(ch).toLowerCase());
else if (fRetainCaseMode == RC_FIRSTUPPER) {
- buf.append(Character.toUpperCase(ch));
+ buf.append(String.valueOf(ch).toUpperCase());
fRetainCaseMode= RC_MIXED;
} else
buf.append(ch);

Back to the top