diff --git a/ChangeLog b/ChangeLog index f1bb99ae0e..ed84679ddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat May 10 22:37:56 2014 Nobuyoshi Nakada + + * dir.c (push_glob): match in UTF-8 on Mac OS X. + [ruby-dev:48213] [Bug #9825] + Sat May 10 13:32:18 2014 Nobuyoshi Nakada * thread.c (thread_start_func_2): stop if forked in a sub-thread, diff --git a/dir.c b/dir.c index f456e8b867..777fa55b63 100644 --- a/dir.c +++ b/dir.c @@ -1745,10 +1745,16 @@ static int push_glob(VALUE ary, VALUE str, int flags) { struct glob_args args; +#ifdef __APPLE__ + rb_encoding *enc = rb_utf8_encoding(); + + str = rb_str_encode_ospath(str); +#else rb_encoding *enc = rb_enc_get(str); if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding(); if (enc == rb_usascii_encoding()) enc = rb_ascii8bit_encoding(); +#endif args.func = push_pattern; args.value = ary; args.enc = enc;