Feature #2255

unicode parameters cannot be passed to ruby

Added by Vit Ondruch over 2 years ago. Updated 10 months ago.

[ruby-core:26232]
Status:Assigned Start date:10/22/2009
Priority:Normal Due date:
Assignee:Usaku NAKAMURA % Done:

0%

Category:M17N
Target version:2.0.0

Description

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

Related issues

related to ruby-trunk - Bug #1771: system()/popen()/popen3() & windows & unicode is not working Assigned 07/13/2009
related to ruby-trunk - Bug #1685: Some windows unicode path issues remain Assigned 06/24/2009

History

Updated by Usaku NAKAMURA over 2 years ago

Hello,

In message "[ruby-core:26232] [Feature #2255] unicode parameters cannot be passed to ruby"
    on Oct.22,2009 20:42:24, <redmine@ruby-lang.org> 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 <usa@garbagecollect.jp>

Updated by Vit Ondruch over 2 years ago

> 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 Usaku NAKAMURA over 2 years ago

Hello,

In message "[ruby-core:26234] [Feature #2255] unicode parameters cannot be passed to ruby"
    on Oct.22,2009 21:05:27, <redmine@ruby-lang.org> 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 <usa@garbagecollect.jp>

Updated by Vit Ondruch over 2 years ago

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 Yui NARUSE over 2 years ago

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

Updated by Vit Ondruch over 2 years ago

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

Updated by Vit Ondruch over 2 years ago

  • File accept_unicode_parameters.diff added
Attached patch should fix this issue.

Updated by Vit Ondruch over 2 years ago

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

Thank you

Updated by Yui NARUSE over 2 years ago

  • File deleted (accept_unicode_parameters.diff)

Updated by Kazuhiro NISHIYAMA almost 2 years ago

  • Target version set to 2.0.0

Updated by Usaku NAKAMURA almost 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA

Also available in: Atom PDF