Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UTF-8 encoding for @cmdfile #17704

Open
dlangBugzillaToGithub opened this issue Apr 20, 2015 · 3 comments
Open

Use UTF-8 encoding for @cmdfile #17704

dlangBugzillaToGithub opened this issue Apr 20, 2015 · 3 comments

Comments

@dlangBugzillaToGithub
Copy link

Dāvis (@davispuh) reported this on 2015-04-20T21:53:18Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=14474

CC List

Description

Currently `dmd @cmdfile` will read file as simple char string. But when DUB is compiling and creating this file it always saves it in UTF-8.

This makes a problem when cmdfile contains paths (source files) with non-ASCII paths/names and thus DMD interprets them incorrectly (it always uses WinAPI ANSI functions which expects them to be encoded in Windows default ANSI code page)

Such cmdfile file with non-ASCII paths encoded as UTF-8 will produce "Error: cannot read file"

One solution could be to change DUB to save it in Windows default ANSI code page, but I think that's a very bad idea because then that file won't be portable.

So best would be to enforce it being in UTF-8 encoding and then decode in DMD for respective code page which is used for WinAPI calls.
@dlangBugzillaToGithub
Copy link
Author

davispuh commented on 2015-04-20T22:21:13Z

Created a quick PR https://github.com/D-Programming-Language/dmd/pull/4602

@dlangBugzillaToGithub
Copy link
Author

code (@MartinNowak) commented on 2015-04-22T00:08:17Z

(In reply to Dāvis from comment #0)
> One solution could be to change DUB to save it in Windows default ANSI code
> page, but I think that's a very bad idea because then that file won't be
> portable.

It doesn't need to be portable, it's just used for a single compiler invocation.

> So best would be to enforce it being in UTF-8 encoding and then decode in
> DMD for respective code page which is used for WinAPI calls.

UTF-8 sounds reasonable.

@dlangBugzillaToGithub
Copy link
Author

menodinulla commented on 2019-11-02T08:30:30Z

Is anyone working on this issue?

This PR is closed but doesn't seem to be resolved.
https://github.com/dlang/dmd/pull/4602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant