mono无法访问包含unicode字符(非ASCII)的目录或文件名?

mono无法访问包含unicode字符(非ASCII)的目录或文件名?,unicode,mono,directory,Unicode,Mono,Directory,[单声道3.2.1] 使用Directory.getfilesystem或Directory.GetDirectories方法无法获取中文目录。为什么 有没有办法解决这个问题 [例如] 目录结构: Contents |--zipfile |--sub |--1.txt |--中文.txt |--中文 |--2.txt 代码: 无法获取“中文"

[单声道3.2.1]

使用Directory.getfilesystem或Directory.GetDirectories方法无法获取中文目录。为什么

有没有办法解决这个问题

[例如]

目录结构:

  Contents
      |--zipfile
             |--sub
             |--1.txt
             |--中文.txt
             |--中文
                 |--2.txt
代码:

无法获取“中文" 目录和“中文.txt“文件。

对我有用:

jcomeau@aspire:/tmp$ mcs -o test.csx test.cs
warning CS8029: Compatibility: Use -out:FILE instead of --output FILE or -o FILE
jcomeau@aspire:/tmp$ mkdir  漢語
jcomeau@aspire:/tmp$ ls
bitcoin.tmp       litecoin.tmp    pulse-2L9K88eMlGn7  test.cs   漢語
CRX_75DAF8CB7768  pcaresult.html  pulse-PKdhtXMmr18n  test.csx
jcomeau@aspire:/tmp$ mono ./test.csx
./.ICE-unix
./.X0-lock
./.X11-unix
./.google-talk-plugin-jcomeau.lock
./.org.chromium.Chromium.kFgd2O
./CRX_75DAF8CB7768
./bitcoin.tmp
./litecoin.tmp
./pcaresult.html
./pulse-2L9K88eMlGn7
./pulse-PKdhtXMmr18n
./test.cs
./test.csx
./漢語
jcomeau@aspire:/tmp$ cat test.cs
using System;
using System.IO;
public class Test {
 static public void Main() {
  foreach (String filename in Directory.GetFileSystemEntries(".")) {
   Console.WriteLine("{0}", filename);
  }
 }
}
为我工作:

jcomeau@aspire:/tmp$ mcs -o test.csx test.cs
warning CS8029: Compatibility: Use -out:FILE instead of --output FILE or -o FILE
jcomeau@aspire:/tmp$ mkdir  漢語
jcomeau@aspire:/tmp$ ls
bitcoin.tmp       litecoin.tmp    pulse-2L9K88eMlGn7  test.cs   漢語
CRX_75DAF8CB7768  pcaresult.html  pulse-PKdhtXMmr18n  test.csx
jcomeau@aspire:/tmp$ mono ./test.csx
./.ICE-unix
./.X0-lock
./.X11-unix
./.google-talk-plugin-jcomeau.lock
./.org.chromium.Chromium.kFgd2O
./CRX_75DAF8CB7768
./bitcoin.tmp
./litecoin.tmp
./pcaresult.html
./pulse-2L9K88eMlGn7
./pulse-PKdhtXMmr18n
./test.cs
./test.csx
./漢語
jcomeau@aspire:/tmp$ cat test.cs
using System;
using System.IO;
public class Test {
 static public void Main() {
  foreach (String filename in Directory.GetFileSystemEntries(".")) {
   Console.WriteLine("{0}", filename);
  }
 }
}

发布一些代码!一个简单、完整的示例来说明问题。发布一些代码!一个简单、完整的示例来说明问题。但是我不能。我的操作系统是Debian 6。有任何设置?区域设置或语言?当您在具有unicode中文目录名的目录中运行此程序时,您会看到什么?请发布输出。(我正在运行Debian 7.1)LANG=en_US.UTF-8 XTERM\u LOCALE=en_US.UTF-8FindNextFile:'的编码错误/中文' 考虑使用MyAuthExalEngEngEngsStage搜索这个页面,以供使用:也许这个问题现在和我回答的问题有很大的不同。你应该做更多的研究并发布一个新的问题。但是我不能。我的操作系统是Debian 6。任何设置?区域设置还是语言?当你运行这个程序时,你看到了什么?具有unicode中文目录名的目录?请发布输出。(我正在运行Debian 7.1)LANG=en_US.UTF-8 XTERM\u LOCALE=en_US.UTF-8FindNextFile:对“”的编码错误/中文' 考虑使用单值外部编码来搜索这个页面,以便于使用:也许这个问题现在和我回答的问题有很大的不同。你应该做更多的研究并发表一个新的问题。