Quoting Henri Gomez <[EMAIL PROTECTED]>:

Oups, attachment missing :

> Hi to all,
> 
> A coworker found some more problems with jspc encoding and
> provided the attached patch for 3.3.1.
> 
> Thanks to take a look and apply (didn't have access to 
> cvs via ssh for now).
> 
> Regards
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 



Index: org/apache/jasper/compiler/CharDataGenerator.java
===================================================================
RCS file: 
c:/data/cvs/jakarta-tomcat-3.3.1/org/apache/jasper/compiler/CharDataGenerator.java,v
retrieving revision 1.1
diff -u -r1.1 CharDataGenerator.java
--- org/apache/jasper/compiler/CharDataGenerator.java   5 Jul 2002 10:20:22 -0000      
 1.1
+++ org/apache/jasper/compiler/CharDataGenerator.java   8 Jul 2002 11:07:35 -0000
@@ -123,7 +123,7 @@
                sb.append("\\t");
                break;
            default:
-               sb.append((char) ch);
+               this.writeChar((char) ch, sb);
            }
        }
        writer.print(sb.toString());
@@ -131,6 +131,18 @@
        writer.println();
     }
 
-
+    protected void writeChar( char c, StringBuffer buf ) {
+        if ( c < 128 )
+       // if char is pure ASCII -> write it
+            buf.append( c );
+        else {
+        // if char isn't pure ASCII -> write it's unicode
+            buf.append( "\\u" );
+            String hexa = Integer.toHexString( c );
+            for( int i = hexa.length() ; i < 4 ; i++ )
+                buf.append( '0' );
+            buf.append( hexa );
+        }
+    }
 
 }
Index: org/apache/jasper/compiler/MappedCharDataGenerator.java
===================================================================
RCS file: 
c:/data/cvs/jakarta-tomcat-3.3.1/org/apache/jasper/compiler/MappedCharDataGenerator.java,v

retrieving revision 1.1
diff -u -r1.1 MappedCharDataGenerator.java
--- org/apache/jasper/compiler/MappedCharDataGenerator.java     5 Jul 2002 10:20:24 
-0000       1.1
+++ org/apache/jasper/compiler/MappedCharDataGenerator.java     8 Jul 2002 11:07:35 
+-0000
@@ -113,7 +113,7 @@
                sb.append("\\t");
                break;
            default:
-               sb.append((char) ch);
+               this.writeChar((char) ch, sb);
            }
        }
        writer.print(sb.toString());
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to