简体   繁体   English

中文文件夹中file.listFiles()的编码问题

[英]Encoding issue for file.listFiles() on chinese folders

I made a research to find similar issues with wrong file name for chinese folders but without luck. 我进行了一项研究,以查找中文文件夹的文件名错误但没有运气的类似问题。 API call listFiles call on file return list of files with unrecognized symbols in file path for chinese symbols. API调用listFiles调用中文符号的文件路径中带有无法识别符号的文件的file返回列表。 The interesting point is for some files chinese symbols are recognized, bit for others are not. 有趣的一点是,对于某些文件,可以识别中文符号,而对于其他文件则不能识别。 Below is the sample: 下面是示例:

http://pastebin.com/2esW80BJ http://pastebin.com/2esW80BJ

Do you have an idea why it happens? 您知道为什么会发生吗? Behind the scene listFiles should use UTF-8 which should be properly handle Chinese chars. 后台listFiles应该使用UTF-8,它应该正确处理中文字符。 It does, but for some cases there are unrecognized symbols. 可以,但是在某些情况下,存在无法识别的符号。

就我而言,这是作为输入的垃圾-具有不同的型号,昨天晚上没有注意到差异

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM