Bug #8776

script_name's encoding is wrong

Added by 贾 延平 almost 2 years ago. Updated almost 2 years ago.

[ruby-core:56547]
Status:Rejected
Priority:Normal
Assignee:-
ruby -v:ruby 2.1.0dev (2013-08-10 trunk 42491) [i386-mingw32] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

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

script_name.patch Magnifier (2.27 KB) 贾 延平, 08/11/2013 04:17 PM

History

#1 Updated by Nobuyoshi Nakada almost 2 years ago

  • Status changed from Open to Rejected

External file path is expected filesystem encoding by default.

#2 Updated by 贾 延平 almost 2 years ago

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?

#3 Updated by Nobuyoshi Nakada almost 2 years ago

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.

#4 Updated by 贾 延平 almost 2 years ago

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?

#5 Updated by 贾 延平 almost 2 years ago

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.

Also available in: Atom PDF