Project

General

Profile

Actions

Bug #8776

closed

script_name's encoding is wrong

Added by jiayp@glodon.com (贾 延平) over 11 years ago. Updated over 11 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) over 11 years ago

  • Status changed from Open to Rejected

External file path is expected filesystem encoding by default.

Updated by jiayp@glodon.com (贾 延平) over 11 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?

Updated by nobu (Nobuyoshi Nakada) over 11 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.

Updated by jiayp@glodon.com (贾 延平) over 11 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?

Updated by jiayp@glodon.com (贾 延平) over 11 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0