# \[Closed\] '?' is not match to multibyte character at commandline globbing on Windows

**URL:** <https://www.ruby-forum.com/t/closed-is-not-match-to-multibyte-character-at-commandline-globbing-on-windows/233266>\
**Category:** Development\
**Created:** [November 29, 2014, 8:54am UTC](https://www.ruby-forum.com/t/closed-is-not-match-to-multibyte-character-at-commandline-globbing-on-windows/233266 "2014-11-29T08:54:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 29, 2014, 8:54am UTC](https://www.ruby-forum.com/t/closed-is-not-match-to-multibyte-character-at-commandline-globbing-on-windows/233266/1 "2014-11-29T08:54:25Z")

</div>

Issue #10555 has been updated by Nobuyoshi N…

Status changed from Assigned to Closed  
% Done changed from 0 to 100

Applied in changeset r48648.

* * *

win32.c: use UTF-8 for argv

- ruby.c (ruby\_set\_argv): convert argv from UTF-8.
- win32/win32.c (rb\_w32\_sysinit, cmdglob, w32\_cmdvector): convert  
wide char command line to UTF-8 argv, and glob in UTF-8 so that  
metacharacters would match multibyte characters.  
[ruby-dev:48752] [Bug #10555]

* * *

Bug #10555: ‘?’ is not match to multibyte character at commandline  
globbing on Windows

> **[Bug #10555: '?' is not match to multibyte character at commandline globbing...](https://bugs.ruby-lang.org/issues/10555#change-50179)**
>
> Redmine

- Author: Usaku NAKAMURA
- Status: Closed
- Priority: Normal
- Assignee: cruby-windows
- Category: M17N
- Target version: current: 2.2.0
- ruby -v: -
- Backport: 2.0.0: REQUIRED, 2.1: REQUIRED

* * *

以下のような現象です。

```auto
D:\test> dir ?.txt
(snip)
2014/11/29 05:46 0 あ.txt
               1 個のファイル 0 バイト
               0 個のディレクトリ 114,140,901,376 バイトの空き領域

D:\test> ruby -e "p ARGV" ?.txt
["?.txt"]

```

原因は、glob処理として`ruby_brace_glob()`を呼んでいるためにencoding情報が渡されないためで、`ruby_blace_glob_with_enc()`を呼ばないといけません。  
1.9以降の全ての版が該当します。

直し方はなかださんのパッチ袋に入ってるので省略。
