summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/pure/generator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/pure/generator.rb')
-rw-r--r--ext/json/lib/json/pure/generator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/lib/json/pure/generator.rb b/ext/json/lib/json/pure/generator.rb
index 0fe73be41a7..c8bbfd09eeb 100644
--- a/ext/json/lib/json/pure/generator.rb
+++ b/ext/json/lib/json/pure/generator.rb
@@ -40,7 +40,7 @@ module JSON
# Convert a UTF8 encoded Ruby string _string_ to a JSON string, encoded with
# UTF16 big endian characters as \u????, and return it.
def utf8_to_json(string) # :nodoc:
- string = string.gsub(/["\\\/\x0-\x1f]/) { |c| MAP[c] }
+ string = string.gsub(/["\\\/\x0-\x1f]/) { MAP[$&] }
string.gsub!(/(
(?:
[\xc2-\xdf][\x80-\xbf] |