Bug #8753
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
=begin A bug introduced by change r42183 #42183 (({__FILE__}))'s __FILE__'s encoding is wrong. In file ((%ruby.c%)) *ruby.c* and function (({load_file_internal})) *load_file_internal* type (({VALUE})) VALUE convert to (({char*})), char*, and lost the encoding info const (({const char *orig_fname = StringValueCStr(argp->fname); StringValueCStr(argp->fname);})) and call the (({rb_parser_compile_file})) *rb_parser_compile_file* with the (({char*})) char* variable (({ tree = rb_parser_compile_file(parser, orig_fname, f, line_start); line_start);})) and in file ((%parse.y%)) *parse.y* and function (({rb_parser_compile_file})), *rb_parser_compile_file*, type (({char*})) char* convert to (({VALUE})) VALUE using the ((*filesystem encoding*)). *filesystem encoding*. (({ return rb_parser_compile_file_path(vparser, rb_filesystem_str_new_cstr(f), file, start); start);})) But the beginning parameter ((*(({argp->fname}))'s encoding*)) *argp->fname's encoding* not the ((*filesystem encoding*)). *filesystem encoding*. What's the principle of ruby's encoding?Why so many (({VALUE})) VALUE to (({char*})) char* converting?Is the (({char*})) char* has the regular encoding? I think we should convert the encoding at the boundary and every thing should encoding to internal encoding in the internal, am I right? =end