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






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




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




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




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



12:08:48 PDT ---
I have no idea why these patches were added to this issue, they were meant to


-- 
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


Andrei Alexandrescu <andrei metalanguage.com> changed:

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



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
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1188




12:19:03 MSD ---
https://github.com/D-Programming-Language/phobos/pull/789

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


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |FIXED



Commits pushed to phobos-1.x at
https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/4e4db66985e76925d2a15cc7f2b83aad625d2e35
Fix Issue 1188 by copying args processing code from druntime

https://github.com/D-Programming-Language/phobos/commit/5469df0b5fa649f8421a981a46815f0288d2a46a


Fix issue 1188

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




Commits pushed to phobos-1.x at
https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/4e4db66985e76925d2a15cc7f2b83aad625d2e35
Fix Issue 1188 by copying args processing code from druntime

https://github.com/D-Programming-Language/phobos/commit/5469df0b5fa649f8421a981a46815f0288d2a46a


Fix issue 1188

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




Commits pushed to phobos-1.x at
https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/f52cb5c94078d9fe73ad9663a861bf195a833888
Fix Issue 1188 by copying args processing code from druntime

https://github.com/D-Programming-Language/phobos/commit/7653b6a20c7053c1994a0496933278369cb93feb


Fix issue 1188

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2012