From: Thomas Gazagnaire Date: Fri, 11 Dec 2009 12:03:12 +0000 (+0000) Subject: [rpc-light] Accept JSON string which contains UTF-XXX characters. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=47ddeac1908978d9d5accbaadcbb51e414b6aa69;p=xcp%2Fxen-api-libs.git [rpc-light] Accept JSON string which contains UTF-XXX characters. Signed-off-by: Thomas Gazagnaire --- diff --git a/rpc-light/jsonrpc.ml b/rpc-light/jsonrpc.ml index aa9c91a..08bcd2e 100644 --- a/rpc-light/jsonrpc.ml +++ b/rpc-light/jsonrpc.ml @@ -154,10 +154,9 @@ module Parser = struct | _ -> 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