From 5ba9427f34800591cb45eb34403c71e2e65fd122 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Thu, 23 Apr 2015 17:21:31 -0700 Subject: change :validate_utf8=false to still emit utf8 validate_utf8=true raises on bad input validate_utf8=false now does not raise, but still produces valid UTF-8 clean JSON by replacing characters. the previous behavior of emitting bad JSON that was not UTF-8 clean when validate_utf8 was false is dropped (and this was behavior only of the C extension and not the ffi extension since the ffi layer must do some scrubbing of its own). --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c6459ed..a1b7ca2 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ hash = parser.parse( json ) * `:check_utf8` * `:dont_validate_strings` * `:symbolize_keys` (default = false): -* `:symbolize_names` (default = false): alias for `:symbolize_keys` +* `:symbolize_names` (default = false): Alias for `:symbolize_keys`. * `:allow_trailing_garbage` * `:allow_multiple_values` * `:allow_partial_values` @@ -79,8 +79,10 @@ hash = parser.parse( json ) ## Encoder Options -* `:pretty` (default = false): -* `:validate_utf8` +* `:pretty` (default = false): Produces more human readable 'pretty' output. +* `:validate_utf8` (default = true): Will raise an exception when trying to + encode strings that are invalid UTF-8. When set to false this still will + procude valid UTF-8 JSON but will replace invalid characters. ## Forcing FFI or C Extension -- cgit v1.2.1