www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1188] New: Phobos doesn't correctly parse command-line arguments containing international characters

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188

           Summary: Phobos doesn't correctly parse command-line arguments
                    containing international characters
           Product: D
           Version: 1.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: thecybershadow gmail.com


This simple program fails (with "file not found") when it's given a filename
containing international characters. I believe this is because Phobos assumes
that the OS sends them as UTF-8...

import std.stdio;
import std.file;

void main(char[][] argv)
{
        char[] data = cast(char[]) read(argv[1]);
        writef("%s", data);
}

Marked as P2 because it makes D command-line programs unusable with files
containing international characters.


-- 
Apr 24 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188





------- Comment #1 from thecybershadow gmail.com  2007-04-24 16:43 -------
Quick workaround: import std.windows.charset and add:

        foreach(ref arg;argv) arg = fromMBSz(arg.ptr);

at the beginning of main().


-- 
Apr 24 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 11 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188



--- Comment #2 from Robert Clipsham <robert octarineparrot.com> 2010-03-27
12:02:38 PDT ---
Created an attachment (id=590)
objdump --dwarf test > dwarf

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 27 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188



--- Comment #3 from Robert Clipsham <robert octarineparrot.com> 2010-03-27
12:03:10 PDT ---
Created an attachment (id=591)
objdump --dwarf test > dwarf2

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 27 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188



--- Comment #4 from Robert Clipsham <robert octarineparrot.com> 2010-03-27
12:07:00 PDT ---
Created an attachment (id=592)
diff -u dwarf2 dwarf

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 27 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188


Robert Clipsham <robert octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert octarineparrot.com


--- Comment #5 from Robert Clipsham <robert octarineparrot.com> 2010-03-27
12:08:48 PDT ---
I have no idea why these patches were added to this issue, they were meant to
be added to bug #3987...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 27 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|andrei metalanguage.com     |nobody puremagic.com


--- Comment #6 from Andrei Alexandrescu <andrei metalanguage.com> 2011-06-05
08:10:22 PDT ---
Putting this task up for grabs as I don't have a Windows system to test on.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 05 2011