Bug 1188 – Command-line arguments are encoded in CP_ACP on Windows instead of UTF-8

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
All
OS
Windows
Creation time
2007-04-24T16:25:00Z
Last change time
2012-11-20T06:16:55Z
Assigned to
nobody
Creator
dlang-bugzilla

Attachments

IDFilenameSummaryContent-TypeSize
590dwarfobjdump --dwarf test > dwarftext/plain9367
591dwarf2objdump --dwarf test > dwarf2text/plain8228
592dwarf.diffdiff -u dwarf2 dwarftext/x-diff3794

Comments

Comment #0 by dlang-bugzilla — 2007-04-24T16:25:55Z
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.
Comment #1 by dlang-bugzilla — 2007-04-24T16:43:41Z
Quick workaround: import std.windows.charset and add: foreach(ref arg;argv) arg = fromMBSz(arg.ptr); at the beginning of main().
Comment #2 by robert — 2010-03-27T12:02:38Z
Created attachment 590 objdump --dwarf test > dwarf
Comment #3 by robert — 2010-03-27T12:03:10Z
Created attachment 591 objdump --dwarf test > dwarf2
Comment #4 by robert — 2010-03-27T12:07:00Z
Created attachment 592 diff -u dwarf2 dwarf
Comment #5 by robert — 2010-03-27T12:08:48Z
I have no idea why these patches were added to this issue, they were meant to be added to bug #3987...
Comment #6 by andrei — 2011-06-05T08:10:22Z
Putting this task up for grabs as I don't have a Windows system to test on.
Comment #7 by verylonglogin.reg — 2012-09-12T01:19:03Z
Comment #8 by github-bugzilla — 2012-11-01T14:54:35Z
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 Merge pull request #789 from denis-sh/fix-Issue-1188 Fix issue 1188
Comment #9 by github-bugzilla — 2012-11-20T06:16:55Z
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 Merge pull request #962 from denis-sh/fix2-Issue-1188 Fix issue 1188