import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.Locale;
import javax.el.ELException;
import javax.el.ExpressionFactory;
Node.Root root = pageDir.getRoot();
String configEnc = root.getJspConfigPageEncoding();
- String pageDirEnc = thePageDirEnc.toUpperCase();
+ String pageDirEnc = thePageDirEnc.toUpperCase(Locale.ENGLISH);
/*
* Compare the 'pageEncoding' attribute of the page directive with
* "UTF-16LE" as identical.
*/
if (configEnc != null) {
- configEnc = configEnc.toUpperCase();
+ configEnc = configEnc.toUpperCase(Locale.ENGLISH);
if (!pageDirEnc.equals(configEnc)
&& (!pageDirEnc.startsWith("UTF-16") || !configEnc
.startsWith("UTF-16"))) {
* identical.
*/
if ((root.isXmlSyntax() && root.isEncodingSpecifiedInProlog()) || root.isBomPresent()) {
- String pageEnc = root.getPageEncoding().toUpperCase();
+ String pageEnc = root.getPageEncoding().toUpperCase(Locale.ENGLISH);
if (!pageDirEnc.equals(pageEnc)
&& (!pageDirEnc.startsWith("UTF-16") || !pageEnc
.startsWith("UTF-16"))) {
Node.TagDirective pageDir) throws JasperException {
Node.Root root = pageDir.getRoot();
- String pageDirEnc = thePageDirEnc.toUpperCase();
+ String pageDirEnc = thePageDirEnc.toUpperCase(Locale.ENGLISH);
/*
* Compare the 'pageEncoding' attribute of the page directive with
* the encoding specified in the XML prolog (only for XML syntax,
* identical.
*/
if ((root.isXmlSyntax() && root.isEncodingSpecifiedInProlog()) || root.isBomPresent()) {
- String pageEnc = root.getPageEncoding().toUpperCase();
+ String pageEnc = root.getPageEncoding().toUpperCase(Locale.ENGLISH);
if (!pageDirEnc.equals(pageEnc)
&& (!pageDirEnc.startsWith("UTF-16") || !pageEnc
.startsWith("UTF-16"))) {
public static String getContentTypeAttribute(String input, String name) {
int begin;
int end;
- int index = input.toUpperCase().indexOf(name.toUpperCase());
+ int index = input.toUpperCase(Locale.ENGLISH).indexOf(name.toUpperCase(Locale.ENGLISH));
if (index == -1) return null;
index = index + name.length(); // positioned after the attribute name
index = input.indexOf('=', index); // positioned at the '='