From: merch-redmine@... Date: 2019-08-03T00:01:45+00:00 Subject: [ruby-core:94121] [Ruby master Bug#6566] JSON.dump can generate invalid UTF-8 sequence Issue #6566 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Assigned to Closed I think this was fixed upstream last year: https://github.com/flori/json/commit/91a24ecac3d722bc3e545fdd0657ed225e91c2df ---------------------------------------- Bug #6566: JSON.dump can generate invalid UTF-8 sequence https://bugs.ruby-lang.org/issues/6566#change-80369 * Author: shyouhei (Shyouhei Urabe) * Status: Closed * Priority: Normal * Assignee: naruse (Yui NARUSE) * Target version: * ruby -v: ruby 2.0.0dev (2012-06-09) [x86_64-linux] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- =begin Look, in the following code JSON.dump outputs a sequence invalid as UTF-8. # -*- encoding: utf-8 -*- require 'json' IO.popen('hexdump -C', 'w') do |fp| JSON.dump(["\xea"], fp) end RFC4627 says that to encode JSON as a Unicode is a "SHALL". So this is an RFC violation. =end ---Files-------------------------------- bug-6566.diff (1.62 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: