Revision: 10146
Author:   [email protected]
Date:     Thu May  5 08:31:56 2011
Log:      Chrome 11 mangles more Unicode characters, so we quote them.

Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=10146

Modified:
/trunk/user/src/com/google/gwt/user/client/rpc/impl/ClientSerializationStreamWriter.java /trunk/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java

=======================================
--- /trunk/user/src/com/google/gwt/user/client/rpc/impl/ClientSerializationStreamWriter.java Mon Mar 21 12:22:19 2011 +++ /trunk/user/src/com/google/gwt/user/client/rpc/impl/ClientSerializationStreamWriter.java Thu May 5 08:31:56 2011
@@ -30,6 +30,7 @@
   /**
    * Used by JSNI, see {@link #quoteString(String)}.
    */
+  @SuppressWarnings("unused")  // referenced by quoteString
   private static JavaScriptObject regex = getQuotingRegex();

   /**
@@ -90,11 +91,15 @@
       // so we have to encode every non-ASCII character.
       // TODO(jat): revisit when this bug is fixed in Android
       return /[\u0000\|\\\u0080-\uFFFF]/g;
+    } else if (ua.indexOf("chrome/11") != -1) {
+      // Chrome 11 mangles many more characters, so quote most of them
+      // TOOD(jat): remove this when/if fixed
+      return /[\u0000\|\\\u0300-\uFFFF]/g;
     } else if (ua.indexOf("webkit") != -1) {
// other WebKit-based browsers need some additional quoting due to combining // forms and normalization (one codepoint being replaced with another).
       // Verified with Safari 4.0.1 (5530.18)
- return /[\u0000\| \\\u0300-\u03ff\u0590-\u05FF\u0600-\u06ff\u0730-\u074A\u07eb-\u07f3\u0940-\u0963\u0980-\u09ff\u0a00-\u0a7f\u0b00-\u0b7f\u0e00-\u0e7f\u0f00-\u0fff\u1900-\u194f\u1a00-\u1a1f\u1b00-\u1b7f\u1dc0-\u1dff\u1f00-\u1fff\u2000-\u206f\u20d0-\u20ff\u2100-\u214f\u2300-\u23ff\u2a00-\u2aff\u3000-\u303f\uD800-\uFFFF]/g; + return /[\u0000\| \\\u0300-\u03ff\u0590-\u05FF\u0600-\u06ff\u0730-\u074A\u07eb-\u07f3\u0940-\u0963\u0980-\u09ff\u0a00-\u0a7f\u0b00-\u0b7f\u0e00-\u0e7f\u0f00-\u0fff\u1900-\u194f\u1a00-\u1a1f\u1b00-\u1b7f\u1cda-\u1cdc\u1dc0-\u1dff\u1f00-\u1fff\u2000-\u206f\u20d0-\u20ff\u2100-\u214f\u2300-\u23ff\u2a00-\u2aff\u3000-\u303f\uaab2-\uaab4\uD800-\uFFFF]/g;
     } else {
       return /[\u0000\|\\\uD800-\uFFFF]/g;
     }
=======================================
--- /trunk/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java Fri Jan 21 11:43:33 2011 +++ /trunk/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java Thu May 5 08:31:56 2011
@@ -458,6 +458,10 @@
         // This can be expanded into a break followed by a hyphen
         return true;
       default:
+        if (ch < ' ') {
+          // Chrome 11 mangles control characters
+          return true;
+        }
         switch (Character.getType(ch)) {
           // Conservative
           case Character.COMBINING_SPACING_MARK:

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to