@@ -141,7 +141,7 @@ class MissingUnicodeSupport < JSONError; end
141
141
# structures. Disable depth checking with :max_nesting => false. It
142
142
# defaults to 100.
143
143
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
144
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
144
+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
145
145
# to false.
146
146
# * *symbolize_names*: If set to true, returns symbols for the names
147
147
# (keys) in a JSON object. Otherwise strings are returned. Strings are
@@ -165,7 +165,7 @@ def parse(source, opts = {})
165
165
# parse! methods defaults to not doing max depth checking: This can be
166
166
# dangerous if someone wants to fill up your stack.
167
167
# * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
168
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
168
+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
169
169
# to true.
170
170
# * *create_additions*: If set to false, the Parser doesn't create
171
171
# additions even if a matching class and create_id was found. This option
@@ -402,27 +402,9 @@ def dump(obj, anIO = nil, limit = nil)
402
402
raise ArgumentError , "exceed depth limit"
403
403
end
404
404
405
- # Swap consecutive bytes of _string_ in place.
406
- def self . swap! ( string ) # :nodoc:
407
- 0 . upto ( string . size / 2 ) do |i |
408
- break unless string [ 2 * i + 1 ]
409
- string [ 2 * i ] , string [ 2 * i + 1 ] = string [ 2 * i + 1 ] , string [ 2 * i ]
410
- end
411
- string
412
- end
413
-
414
- # Shortcut for iconv.
415
- if ::String . method_defined? ( :encode )
416
- # Encodes string using Ruby's _String.encode_
417
- def self . iconv ( to , from , string )
418
- string . encode ( to , from )
419
- end
420
- else
421
- require 'iconv'
422
- # Encodes string using _iconv_ library
423
- def self . iconv ( to , from , string )
424
- Iconv . conv ( to , from , string )
425
- end
405
+ # Encodes string using Ruby's _String.encode_
406
+ def self . iconv ( to , from , string )
407
+ string . encode ( to , from )
426
408
end
427
409
428
410
if ::Object . method ( :const_defined? ) . arity == 1
0 commit comments