You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2012/07/08 01:12:17 UTC
svn commit: r1358671 -
/xerces/java/branches/xml-schema-1.1-dev/samples/xni/UpperCaseFilter.java
Author: mrglavas
Date: Sat Jul 7 23:12:17 2012
New Revision: 1358671
URL: http://svn.apache.org/viewvc?rev=1358671&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/branches/xml-schema-1.1-dev/samples/xni/UpperCaseFilter.java
Modified: xerces/java/branches/xml-schema-1.1-dev/samples/xni/UpperCaseFilter.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/xni/UpperCaseFilter.java?rev=1358671&r1=1358670&r2=1358671&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/samples/xni/UpperCaseFilter.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/samples/xni/UpperCaseFilter.java Sat Jul 7 23:12:17 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: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org