# HG changeset patch # User Thomas Gazagnaire [rpc-light] Accept JSON string which contains UTF-XXX characters. Signed-off-by: Thomas Gazagnaire 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