Project

General

Profile

Actions

Bug #11787

closed

rb_inspect() should check Encoding.default_internal instead of Encoding.default_external

Added by shugo (Shugo Maeda) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
[ruby-dev:49415]

Description

rb_inspect() checks Encoding.default_external even if Encoding.default_internal is specified.

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

Encoding.default_internal should be check instead.


Files

Updated by shugo (Shugo Maeda) over 8 years ago

Shugo Maeda wrote:

Encoding.default_internal should be check instead.

I've attached a patch.

Updated by naruse (Yui NARUSE) over 8 years ago

Looks good the concept.
Could you rebase and commit it?

Actions #3

Updated by shugo (Shugo Maeda) over 8 years ago

  • Status changed from Open to Closed

Applied in changeset r53067.


  • object.c (rb_inspect): check the default internal encoding as
    String#inspect do.
    [ruby-dev:49415] [Bug #11787]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0