Project

General

Profile

Actions

Feature #2255

closed

unicode parameters cannot be passed to ruby

Feature #2255: unicode parameters cannot be passed to ruby

Added by vo.x (Vit Ondruch) almost 16 years ago. Updated about 8 years ago.

Status:
Closed
Assignee:
Target version:
[ruby-core:26232]

Description

On windows, Ruby should provide wmain to allow passing unicode parameters (especially file paths are of interest).


Related issues 3 (0 open3 closed)

Related to Ruby - Bug #1771: system()/popen()/popen3() & windows & unicode is not workingClosedusa (Usaku NAKAMURA)Actions
Related to Ruby - Bug #1685: Some windows unicode path issues remainClosedusa (Usaku NAKAMURA)Actions
Related to Ruby - Bug #10555: '?' is not match to multibyte character at commandline globbing on WindowsClosedwindowsActions

Updated by usa (Usaku NAKAMURA) almost 16 years ago Actions #1

Hello,

In message "[ruby-core:26232] [Feature #2255] unicode parameters cannot be passed to ruby"
on Oct.22,2009 20:42:24, wrote:

On windows, Ruby should provide wmain to allow passing unicode parameters (especially file paths are of interest).

It doesn't make sense.

BTW, we have tha plan that UTF-8'ed ARGV with -Eutf-8 option,
but not implemented yet.

Regards,

--
U.Nakamura

Updated by vo.x (Vit Ondruch) almost 16 years ago Actions #2

It doesn't make sense.

Why? May be wmain is not the right thing, but at least Unicode parameters should be possible to accept if it is windows application (probably using GetCommandLineW API function). UTF-8 is nice but that is different story.

Updated by usa (Usaku NAKAMURA) almost 16 years ago Actions #3

Hello,

In message "[ruby-core:26234] [Feature #2255] unicode parameters cannot be passed to ruby"
on Oct.22,2009 21:05:27, wrote:

Why? May be wmain is not the right thing, but at least Unicode parameters should be possible to accept if it is windows application (probably using GetCommandLineW API function). UTF-8 is nice but that is different story.

Yes, using GetCommandLineW() is correct way, and providing wmain()
is nonsence. (Who use it?)

Our current plan is that using UTF-8 instead of UTF-16LE as internal
Windows strings.
We have not fixed whether supporting to pass UTF-16LE'ed ARGV to user
script or not.
If we will do so, the priority might be low.

Regards,

--
U.Nakamura

Updated by vo.x (Vit Ondruch) almost 16 years ago Actions #4

For me, internal encoding doesn't matter, since the conversion is pretty easy. But important is that the following example will work properly:

C:\>echo puts ARGV[0] > uparam.rb

C:\>ruby\bin\ruby.exe uparam.rb của_zufällige_žluťoučký_разлога
c?a_zufällige_žluoučký_???????

C:\>

Updated by naruse (Yui NARUSE) almost 16 years ago Actions #5

Did you try latest ruby-trunk?
It should run already.

Updated by vo.x (Vit Ondruch) almost 16 years ago Actions #6

I tried ruby 1.9.2dev (2009-10-15) [i386-mswin32_90] from win32-unicode-test branch.

Updated by vo.x (Vit Ondruch) almost 16 years ago Actions #7

  • File accept_unicode_parameters.diff added

Attached patch should fix this issue.

Updated by vo.x (Vit Ondruch) almost 16 years ago Actions #8

Ouch, sorry, this is patch for something bit different. Please forget about it (delete it if possible).

Thank you

Updated by naruse (Yui NARUSE) almost 16 years ago Actions #9

  • File deleted (accept_unicode_parameters.diff)

Updated by znz (Kazuhiro NISHIYAMA) over 15 years ago Actions #10

  • Target version set to 2.0.0

Updated by usa (Usaku NAKAMURA) over 15 years ago Actions #11

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

Updated by usa (Usaku NAKAMURA) almost 13 years ago Actions #12 [ruby-core:48465]

  • Description updated (diff)

I think that if -Eutf-8 is specified ARGV should be parsed from GetCommandLineW()
and converted to UTF-8.
But it's difficult to change ruby with keeping compatibility.
I'll try it till code freeze, but I can't promise that it will be in time for 2.0.

Updated by mame (Yusuke Endoh) almost 13 years ago Actions #14 [ruby-core:49938]

Usa-san, what's the status?

--
Yusuke Endoh

Updated by usa (Usaku NAKAMURA) almost 13 years ago Actions #15 [ruby-core:50150]

% Done: 0% ;-(

Updated by ko1 (Koichi Sasada) over 12 years ago Actions #16 [ruby-core:52801]

  • Target version changed from 2.0.0 to 2.1.0

ping -> usa

Updated by hsbt (Hiroshi SHIBATA) over 11 years ago Actions #17 [ruby-core:60257]

  • Target version changed from 2.1.0 to 2.2.0

Updated by usa (Usaku NAKAMURA) about 8 years ago Actions #18 [ruby-core:83473]

  • Assignee changed from usa (Usaku NAKAMURA) to windows

Updated by nobu (Nobuyoshi Nakada) about 8 years ago Actions #19

  • Related to Bug #10555: '?' is not match to multibyte character at commandline globbing on Windows added

Updated by nobu (Nobuyoshi Nakada) about 8 years ago Actions #20 [ruby-core:83481]

  • Description updated (diff)

Seems fixed already.

Updated by nobu (Nobuyoshi Nakada) about 8 years ago Actions #21

  • Status changed from Assigned to Closed
Actions

Also available in: PDF Atom