axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/components/encoding UTF16Encoder.java UTF8Encoder.java
Date Thu, 04 Nov 2004 18:23:12 GMT
dims        2004/11/04 10:23:12

  Modified:    java/src/org/apache/axis/components/encoding
                        UTF16Encoder.java UTF8Encoder.java
  Log:
  Don't make a copy of the array...use it as is.
  
  Revision  Changes    Path
  1.4       +3 -3      ws-axis/java/src/org/apache/axis/components/encoding/UTF16Encoder.java
  
  Index: UTF16Encoder.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/components/encoding/UTF16Encoder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UTF16Encoder.java	26 Apr 2004 11:51:43 -0000	1.3
  +++ UTF16Encoder.java	4 Nov 2004 18:23:12 -0000	1.4
  @@ -47,10 +47,10 @@
           if (xmlString == null) {
               return;
           }
  -        char[] characters = xmlString.toCharArray();
  +        int length = xmlString.length();
           char character;
  -        for (int i = 0; i < characters.length; i++) {
  -            character = characters[i];
  +        for (int i = 0; i < length; i++) {
  +            character = xmlString.charAt( i );
               switch (character) {
                   // we don't care about single quotes since axis will
                   // use double quotes anyway
  
  
  
  1.4       +3 -21     ws-axis/java/src/org/apache/axis/components/encoding/UTF8Encoder.java
  
  Index: UTF8Encoder.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/components/encoding/UTF8Encoder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UTF8Encoder.java	26 Apr 2004 11:51:43 -0000	1.3
  +++ UTF8Encoder.java	4 Nov 2004 18:23:12 -0000	1.4
  @@ -48,10 +48,10 @@
           if (xmlString == null) {
               return;
           }
  -        char[] characters = xmlString.toCharArray();
  +        int length = xmlString.length();
           char character;
  -        for (int i = 0; i < characters.length; i++) {
  -            character = characters[i];
  +        for (int i = 0; i < length; i++) {
  +            character = xmlString.charAt( i );
               switch (character) {
                   // we don't care about single quotes since axis will
                   // use double quotes anyway
  @@ -86,24 +86,6 @@
                           writer.write("&#x");
                           writer.write(Integer.toHexString(character).toUpperCase());
                           writer.write(";");
  -                        /*
  -			TODO: Try fixing this block instead of code above.
  -                        if (character < 0x80) {
  -                            writer.write(character);
  -                        } else if (character < 0x800) {
  -                            writer.write((0xC0 | character >> 6));
  -                            writer.write((0x80 | character & 0x3F));
  -                        } else if (character < 0x10000) {
  -                            writer.write((0xE0 | character >> 12));
  -                            writer.write((0x80 | character >> 6 & 0x3F));
  -                            writer.write((0x80 | character & 0x3F));
  -                        } else if (character < 0x200000) {
  -                            writer.write((0xF0 | character >> 18));
  -                            writer.write((0x80 | character >> 12 & 0x3F));
  -                            writer.write((0x80 | character >> 6 & 0x3F));
  -                            writer.write((0x80 | character & 0x3F));
  -                        }
  -                        */
                       } else {
                           writer.write(character);
                       }
  
  
  

Mime
View raw message