|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-api
[Xen-API] [PATCH] [rpc-light] Accept JSON string which contains	UTF-XXX 
 
# HG changeset patch
# User Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>
[rpc-light] Accept JSON string which contains UTF-XXX characters.
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>
diff -r 33811c04f39c rpc-light/jsonrpc.ml
--- a/rpc-light/jsonrpc.ml      Fri Dec 04 17:09:54 2009 +0000
+++ b/rpc-light/jsonrpc.ml      Thu Dec 10 12:45:59 2009 +0000
@@ -154,10 +154,9 @@
                | _ -> false
 
        let is_valid_unescaped_char c =
-               match (Char.code c) with
-                       | 0x22 | 0x5c -> false
-                       | x when 0x20 <= x && x <= 0x7f -> true  (* only ASCII 
for now *)
-                       | _ -> false
+               match c with
+                       | '"' | '\\' | '\b' | '\x0c' | '\n' | '\r' | '\t' -> 
false
+                       | _ -> true
 
        let clist_to_string cs =
                let len = List.length cs in
 
xapi-libs-accept-utfX-when-parsing-json 
Description: Text document 
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
 
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread> |  
- [Xen-API] [PATCH] [rpc-light] Accept JSON string which contains	UTF-XXX characters.,
Thomas Gazagnaire <=
  
 |  
  
 | 
    | 
  
  
    |   | 
    |