aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-02-10 13:17:16 -0500
committerJack Nagel2014-02-10 13:17:16 -0500
commitb754ad0d0b313fa478e427fa99e014c3357db0d3 (patch)
tree5826006d09df3947a9669008ffa419067dec5b18 /Library
parent1eddc73472c2d39f698da2089889b3b7325010a8 (diff)
downloadbrew-b754ad0d0b313fa478e427fa99e014c3357db0d3.tar.bz2
Update vendored OkJson
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/vendor/okjson.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/vendor/okjson.rb b/Library/Homebrew/vendor/okjson.rb
index f4a4d215a..bbec99e8d 100644
--- a/Library/Homebrew/vendor/okjson.rb
+++ b/Library/Homebrew/vendor/okjson.rb
@@ -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