[ruby-dev:49415] [Ruby trunk - Bug #11787] [Open] rb_inspect() should check Encoding.default_internal instead of Encoding.default_external

From: shugo@...
Date: 2015-12-08 07:24:35 UTC
List: ruby-dev #49415
Issue #11787 has been reported by Shugo Maeda.

----------------------------------------
Bug #11787: rb_inspect() should check Encoding.default_internal instead of =
Encoding.default_external
https://bugs.ruby-lang.org/issues/11787

* Author: Shugo Maeda
* Status: Open
* Priority: Normal
* Assignee: Yui NARUSE
* ruby -v:=20
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
rb_inspect() checks Encoding.default_external even if Encoding.default_inte=
rnal is specified.

```
$ cat t.rb
puts "\u3042"
p "\u3042"
$ ruby -E windows-31j:utf-8 t.rb
=E3=81=82
t.rb:2:in `p': inspected result must be ASCII only or use the default exter=
nal encoding (Encoding::CompatibilityError)
	from t/t.rb:2:in `<main>'
```

Encoding.default_internal should be check instead.




--=20
https://bugs.ruby-lang.org/

In This Thread

Prev Next