Re: visuald-1.3.1在windows上使用非英文字符文件名称无法编译问题修正 另外问2个问题
Rainer Schuetze
r.sagitario at gmx.de
Sat Nov 26 09:05:30 UTC 2022
On 24/11/2022 02:10, mm wrote:
> 大家好 hello everyone
>
> 1 visuald-1.3.1 Correction of the problem that the file name with non
> English letters cannot be compiled on Windows
> 1 visuald-1.3.1在windows上使用非英文字符文件名称无法编译问题修正
>
> 修改文件: ..\visuald-1.3.1\msbuild\dbuild\CompileD.cs
> Modify file: ..\visuald-1.3.1\msbuild\dbuild\CompileD.cs
>
> [DllImport("Kernel32.dll")]
> static extern int GetACP();
>
> protected override Encoding ResponseFileEncoding
> {
> get
> {
> // return new UTF8Encoding(false);
> return System.Text.Encoding.GetEncoding(GetACP());
> //用了非英文字母文件名称导致无法编译 改了语言区域 系统
> 又乱码问题
> //The name of a file with non English letters is used,
> //which makes it impossible to compile and change the language
> region system and causes garbled code
> }
> }
>
Thanks, looks good for dmd. DMD assumes the CP_ACP codepage for all
filenames that are passed on the command line and in response files.
Unfortunately that excludes files that have no representation in that
code page (which is system specific).
LDC seems fine with UTF8, but it also has trouble generating consistent
module info symbols.
> -------------------------------------------------------------------------------------
> 2 打开 Intellisense : use DMD parsing engine for semantic analysis选项后
> 自动完成,不提示关键字了. 如 lenght, return, for 这些都不再显示.
> 这个问题是需要修改dmdserver.exe 的源代码么,但是我无法编译它..
> 2. Open the Intellisense: use DMD parsing engine for semantic analysis
> option
>
> Auto complete, no keywords will be prompted For example, lenght,
> return, and for are no longer displayed
> The problem is that need to modify the dmdserver Exe source code
> file?, But I can't compile it
>
Have you tried the x64 configurations? The Win32 ones might be out of
date as they are unused.
> 3 我还有一个问题 windows使用utf8的话会导致系统不正常 ,完全不能用utf8. 但
> 是不用utf8的话文件或路径有非因为字母,会提示找不到文件.
> 如:
> import 你好世界; //它无法找到这个文件
> 这问题是要修改VisualD.dll 源代码文件吗?
>
> 3 I have another problem. If Windows uses utf8, the system will be
> abnormal,
> and you cannot use utf8 at all.
> However, if you do not use utf8, the file or path has non letters,
> and you will be prompted that the file cannot be found.
>
> For example:
>
> Import 你好世界;// It cannot find this file
>
> This question is to modify the source code file of VisualD.dll?
Is your file encoded in UTF8? If yes, it sounds like a compiler issue.
Unfortunately, dmd doesn't use the runtime initialization of the command
line that encodes it as UTF8 from the wide string version.
It's probably best to avoid file names outside the ascii range.
More information about the Digitalmars-d-ide
mailing list