Thread overview
[Issue 7648] New: Can't open file (Windows UTF8)
Mar 05, 2012
deep0125@gmail.com
Mar 11, 2012
Martin Krejcirik
Mar 11, 2012
deep0125@gmail.com
Mar 13, 2012
Martin Krejcirik
Jul 06, 2012
Denis Shelomovskij
[Issue 7648] std.stdio expects file names to be encoded in CP_ACP on Windows instead of UTF-8
Jul 06, 2012
Denis Shelomovskij
Sep 11, 2012
Denis Shelomovskij
March 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648

           Summary: Can't open file (Windows UTF8)
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: deep0125@gmail.com


--- Comment #0 from deep0125@gmail.com 2012-03-05 01:38:28 PST ---
Created an attachment (id=1080)
source and exe

Can't open file.



Look in the archive

source:

-----------------------main.d
import std.stdio;

int main(string[] argv)
{
   auto file2 = File("Привет.txt");
   return 0;
}
---------------------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648


Martin Krejcirik <mk@krej.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mk@krej.cz


--- Comment #1 from Martin Krejcirik <mk@krej.cz> 2012-03-10 16:21:07 PST ---
(In reply to comment #0)
>    auto file2 = File("Привет.txt");

Can't test with this filename as I have no Russian support, but it works for me with accented characters.

import std.stdio, std.stream;

void main(char[][] args)
{
    char[] filename;
    if (args.length==2)
        filename=args[1];
    else
        filename="utfname-žlutý.txt";

    writefln("filename: %s", filename);
    File file = new File(filename);
}

However, what doesn't work is reading UTF8 from the commandline (using chcp
65001):

D:\devel\bugs>utfname
filename: utfname-žlutý.txt

D:\devel\bugs>utfname utfname-zluty.txt
filename: utfname-zluty.txt

D:\devel\bugs>utfname utfname-žlutý.txt
Error: 1invalid UTF-8 sequence
filename:

OS Windows XP Czech

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #2 from deep0125@gmail.com 2012-03-11 07:20:56 PDT ---
(In reply to comment #1)
> (In reply to comment #0)
> >    auto file2 = File("Привет.txt");
> 
> Can't test with this filename as I have no Russian support, but it works for me

Easy, download attached archive and extract to disk.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #3 from Martin Krejcirik <mk@krej.cz> 2012-03-13 15:27:03 PDT ---
(In reply to comment #2)
> Easy, download attached archive and extract to disk.

OK, tried, same error as you reported.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648


Denis Shelomovskij <verylonglogin.reg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg@gmail.com


--- Comment #5 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2012-07-06 11:27:11 MSD ---
(In reply to comment #1)
> However, what doesn't work is reading UTF8 from the commandline (using chcp
> 65001):

Your program is written in (outdated) D1 so you are affected by Issue 1188.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #6 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2012-07-06 11:54:48 MSD ---
*** Issue 8020 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #7 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2012-09-12 00:57:31 MSD ---
Fix for Phobos related part: https://github.com/D-Programming-Language/phobos/pull/788

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #8 from github-bugzilla@puremagic.com 2012-09-16 20:45:24 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e5e123854e28b759418791744402491d82840140
Partial Fix Issue 7648 - std.stdio expects file names to be encoded in CP_ACP
on Windows instead of UTF-8

https://github.com/D-Programming-Language/phobos/commit/53a19c8d32610f5398a717a4e66a746211f5b7c9 Merge pull request #788 from denis-sh/partial-fix-Issue-7648

Partial fix Issue 7648

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #9 from github-bugzilla@puremagic.com 2013-04-17 13:13:08 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/c372571d1f868abd2294944b617f3863184462fe Add note about Issue 7648 to `std.stdio.File`.

Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=7648

https://github.com/D-Programming-Language/phobos/commit/176976a57baf2505db894a314921dbaf8e347154 Merge pull request #1238 from denis-sh/add-note-about-Issue-7648

Add note about Issue 7648 to `std.stdio.File`.

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