Project

General

Profile

Bug #5919

File singleton methods (expand_path, realpath, dirname, basename, extname) should respect encodings

Added by nobu (Nobuyoshi Nakada) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.0.0dev (2012-01-20 trunk 34347) [i386-mingw32]
[ruby-dev:45145]

Description

パス名を扱うFileの特異メソッドで引数のパスのエンコーディングが無視されています。

file_encoding.diff (32 KB) file_encoding.diff nobu (Nobuyoshi Nakada), 01/21/2012 12:04 PM

Related issues

Related to Ruby trunk - Bug #2154: filesystem encoding of UNIXRejected

Associated revisions

Revision 34372
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions.
  • file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [Bug #5919]
  • dir.c (check_dirname, ruby_glob0): ditto.
  • ext/pathname/pathname.c (path_sub_ext): ditto.

Revision 34372
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions.
  • file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [Bug #5919]
  • dir.c (check_dirname, ruby_glob0): ditto.
  • ext/pathname/pathname.c (path_sub_ext): ditto.

Revision 34372
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions.
  • file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [Bug #5919]
  • dir.c (check_dirname, ruby_glob0): ditto.
  • ext/pathname/pathname.c (path_sub_ext): ditto.

Revision 34372
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions.
  • file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [Bug #5919]
  • dir.c (check_dirname, ruby_glob0): ditto.
  • ext/pathname/pathname.c (path_sub_ext): ditto.

History

#1 Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34372.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions.
  • file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [Bug #5919]
  • dir.c (check_dirname, ruby_glob0): ditto.
  • ext/pathname/pathname.c (path_sub_ext): ditto.

Also available in: Atom PDF