Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46564
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 30 Jan 2009 05:30:23 +0000 (05:30 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 30 Jan 2009 05:30:23 +0000 (05:30 +0000)
Encoding test should be case insensitive

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@739176 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Validator.java

index c8168e5..fdc5a56 100644 (file)
@@ -374,16 +374,16 @@ class Validator {
          * Compares page encodings specified in various places, and throws
          * exception in case of page encoding mismatch.
          * 
-         * @param pageDirEnc The value of the pageEncoding attribute of the page
+         * @param thePageDirEnc The value of the pageEncoding attribute of the page
          * directive @param pageDir The page directive node
          * 
          * @throws JasperException in case of page encoding mismatch
          */
-        private void compareTagEncodings(String pageDirEnc,
+        private void compareTagEncodings(String thePageDirEnc,
                 Node.TagDirective pageDir) throws JasperException {
 
             Node.Root root = pageDir.getRoot();
-
+            String pageDirEnc = thePageDirEnc.toUpperCase();
             /*
              * Compare the 'pageEncoding' attribute of the page directive with
              * the encoding specified in the XML prolog (only for XML syntax,
@@ -392,7 +392,7 @@ class Validator {
              * identical.
              */
             if ((root.isXmlSyntax() && root.isEncodingSpecifiedInProlog()) || root.isBomPresent()) {
-                String pageEnc = root.getPageEncoding();
+                String pageEnc = root.getPageEncoding().toUpperCase();
                 if (!pageDirEnc.equals(pageEnc)
                         && (!pageDirEnc.startsWith("UTF-16") || !pageEnc
                                 .startsWith("UTF-16"))) {