Author: mrglavas
Date: Sat Jul  7 23:11:38 2012
New Revision: 1358670

URL: http://svn.apache.org/viewvc?rev=1358670&view=rev
Log:
When normalizing a String object to upper- or lower case one needs to be very 
careful not to rely on the default locale of the platform. This results from 
the fact that Turkish in particular does not map characters to their upper- or 
lower case equivalents in English. Where this could pose a problem, we force 
case conversion to be done according to an English locale.

Modified:
    xerces/java/trunk/samples/xni/UpperCaseFilter.java

Modified: xerces/java/trunk/samples/xni/UpperCaseFilter.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/samples/xni/UpperCaseFilter.java?rev=1358670&r1=1358669&r2=1358670&view=diff
==============================================================================
--- xerces/java/trunk/samples/xni/UpperCaseFilter.java (original)
+++ xerces/java/trunk/samples/xni/UpperCaseFilter.java Sat Jul  7 23:11:38 2012
@@ -17,6 +17,8 @@
 
 package xni;
 
+import java.util.Locale;
+
 import org.apache.xerces.xni.Augmentations;
 import org.apache.xerces.xni.QName;
 import org.apache.xerces.xni.XMLAttributes;
@@ -105,11 +107,11 @@ public class UpperCaseFilter
      */
     protected QName toUpperCase(QName qname) {
         String prefix = qname.prefix != null
-                      ? qname.prefix.toUpperCase() : null;
+                      ? qname.prefix.toUpperCase(Locale.ENGLISH) : null;
         String localpart = qname.localpart != null
-                         ? qname.localpart.toUpperCase() : null;
+                         ? qname.localpart.toUpperCase(Locale.ENGLISH) : null;
         String rawname = qname.rawname != null
-                       ? qname.rawname.toUpperCase() : null;
+                       ? qname.rawname.toUpperCase(Locale.ENGLISH) : null;
         String uri = qname.uri;
         fQName.setValues(prefix, localpart, rawname, uri);
         return fQName;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to