From: "naruse (Yui NARUSE)" Date: 2013-02-17T19:53:12+09:00 Subject: [ruby-core:52377] [ruby-trunk - Bug #6566] JSON.dump can generate invalid UTF-8 sequence Issue #6566 has been updated by naruse (Yui NARUSE). Target version changed from 2.0.0 to next minor ---------------------------------------- Bug #6566: JSON.dump can generate invalid UTF-8 sequence https://bugs.ruby-lang.org/issues/6566#change-36427 Author: shyouhei (Shyouhei Urabe) Status: Assigned Priority: Normal Assignee: naruse (Yui NARUSE) Category: M17N Target version: next minor ruby -v: ruby 2.0.0dev (2012-06-09) [x86_64-linux] =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 -- http://bugs.ruby-lang.org/