Skip to content
Snippets Groups Projects
Commit b754ad0d authored by Jack Nagel's avatar Jack Nagel
Browse files

Update vendored OkJson

parent 1eddc734
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ require 'stringio'
# http://golang.org/src/pkg/utf8/utf8.go
module Vendor
module OkJson
Upstream = '42'
Upstream = '43'
extend self
......@@ -462,11 +462,16 @@ module Vendor
# In ruby >= 1.9, s[r] is a codepoint, not a byte.
if rubydoesenc?
begin
c.ord # will raise an error if c is invalid UTF-8
# c.ord will raise an error if c is invalid UTF-8
if c.ord < Spc.ord
c = "\\u%04x" % [c.ord]
end
t.write(c)
rescue
t.write(Ustrerr)
end
elsif c < Spc
t.write("\\u%04x" % c)
elsif Spc <= c && c <= ?~
t.putc(c)
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment