Thread overview
[Issue 13493] DMD fails to open files with non-ASCII characters on Windows
Sep 21, 2014
Vladimir Panteleev
Sep 21, 2014
Sönke Ludwig
Sep 21, 2014
Sobirari Muhomori
Sep 21, 2014
Vladimir Panteleev
Sep 21, 2014
Vladimir Panteleev
Sep 21, 2014
Vladimir Panteleev
Sep 22, 2014
Sobirari Muhomori
Dec 17, 2022
Iain Buclaw
September 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com

--- Comment #1 from Vladimir Panteleev <thecybershadow@gmail.com> ---
I think this issue is already reported elsewhere.

As of DMD 2.066, you can use windowsHandleOpen to create std.stdio.File objects from arbitrary HANDLEs. This allows circumventing snn.lib's Unicode problems if you can replace File creation with custom code.

I've done this for another reason, accessing very long paths using the UNC path prefix: https://github.com/CyberShadow/ae/blob/master/sys/file.d#L686-L737

--
September 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

--- Comment #2 from Sönke Ludwig <sludwig@outerproduct.org> ---
Just to make sure that there is no misunderstanding, this is about an issue with the DMD command line executable, not about the Phobos issue. I've searched for various keywords but couldn't find any existing issue, even if I would have assumed that something already exists.

--
September 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

--- Comment #3 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
(In reply to Vladimir Panteleev from comment #1)
> snn.lib's Unicode problems

snn has problems with unicode?

--
September 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

--- Comment #4 from Vladimir Panteleev <thecybershadow@gmail.com> ---
Yes, sorry, got confused halfway thinking of a similar issue affecting D programs built with DMD.

--
September 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

--- Comment #5 from Vladimir Panteleev <thecybershadow@gmail.com> ---
(In reply to Sobirari Muhomori from comment #3)
> snn has problems with unicode?

Yes. See issue 7648

--
September 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

--- Comment #6 from Vladimir Panteleev <thecybershadow@gmail.com> ---
(In reply to Sönke Ludwig from comment #0)
> DMD only accepts files that contain ASCII characters (maybe even LATIN1). Everything else results in an error message similar to this:
> 
> $ dmd тєѕт.d
> Error: cannot read file ????.d
> 
> Reproducible with any Cyrillic character.

With DMD 2.066:

> dmd тест.d
Error: invalid file name '.d'

> dmd "тест.d"
(works, and creates тест.exe)

So, I guess it will still accept characters in the user's code page, as long as they are quoted.

--
September 22, 2014
https://issues.dlang.org/show_bug.cgi?id=13493

--- Comment #7 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
(In reply to Vladimir Panteleev from comment #5)
> (In reply to Sobirari Muhomori from comment #3)
> > snn has problems with unicode?
> 
> Yes. See issue 7648

Do you mean this line:
https://github.com/D-Programming-Language/phobos/blob/master/std/stdio.d#L3145
?
Hmm... how does it work? Accepts ansi-encoded string, transcodes it from utf8
to utf16 somehow keeping invalid utf8 sequences, then _wfopen transcodes it
back to utf8 and passes to CreateFileA?

--
June 09, 2015
https://issues.dlang.org/show_bug.cgi?id=13493

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |D2

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=13493

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--