Project

General

Profile

Actions

Bug #8776

closed

script_name's encoding is wrong

Bug #8776: script_name's encoding is wrong

Added by jiayp@glodon.com (贾 延平) about 12 years ago. Updated about 12 years ago.

Status:
Rejected
Assignee:
-
Target version:
ruby -v:
ruby 2.1.0dev (2013-08-10 trunk 42491) [i386-mingw32]
[ruby-core:56547]

Description

there's some wrong encoded string in exception's callstack couse by the script_name;s encoding is wrong .


Files

script_name.patch (2.27 KB) script_name.patch jiayp@glodon.com (贾 延平), 08/11/2013 04:17 PM

Updated by nobu (Nobuyoshi Nakada) about 12 years ago Actions #1 [ruby-core:56550]

  • Status changed from Open to Rejected

External file path is expected filesystem encoding by default.

Updated by jiayp@glodon.com (贾 延平) about 12 years ago Actions #2 [ruby-core:56564]

But the external file path should encoded into internal encoding when it is used in ruby system, is it right?
What is the right opportunity to encode the path and fix the exception's calltack's encoding error?

Updated by nobu (Nobuyoshi Nakada) about 12 years ago Actions #3 [ruby-core:56566]

It's not right.

What is the right opportunity to encode the path and fix the exception's calltack's encoding error?

At the error handling, probably.

Updated by jiayp@glodon.com (贾 延平) about 12 years ago Actions #4 [ruby-core:56570]

I have seen the error handling code and don't know how to fix the error.

I once think ruby will do the encode work at the boundary of the external system as soon as possible,And keep the internal system clear with the internal encoding.If not so,How we know when to encode to what encoding?

Updated by jiayp@glodon.com (贾 延平) about 12 years ago Actions #5 [ruby-core:56571]

In this call flow
rb_f_load -> rb_load_internal -> rb_load_file_str -> load_file -> load_file_internal -> rb_parser_compile_string_path
When load a utf-8 encoded path will be considered a filesystem encoded path and load failure.

Actions

Also available in: PDF Atom