[英]Copying file from Unix to windows changes file name
I am creating some files with dynamic code and dynamic content via code deployed in a Unix system. 我正在通过Unix系统中部署的代码来创建一些具有动态代码和动态内容的文件。 The name of the file changes when it is placed in a windows shared path. 将文件放在Windows共享路径中时,文件名会更改。
EG 例如
Suppose a file name was Ämber.xml which is created in unix system where my code is deployed. 假设文件名为Ämber.xml,该文件是在部署了我的代码的unix系统中创建的。 After the file creation is finished, it is placed in a windows shared path folder. 文件创建完成后,将其放置在Windows共享路径文件夹中。 In the windows shared path folder when I look at the file, the content is perfect but the name changes to Ãmber.xml. 当我查看文件时,在Windows共享路径文件夹中,内容很完美,但是名称更改为Ãmber.xml。 So the Ä changes to Ã. 因此,Ä更改为Ã。 Could you please provide me a solution to this? 您能为我提供解决方案吗? Thank you. 谢谢。
This is ultimately because an UTF-8 filename is interpreted as ISO (or another non-unicode) encoded string. 最终,这是因为UTF-8文件名被解释为ISO(或另一个非Unicode)编码的字符串。
Probably the filename encoding is not configured correctly on the Unix system (or a buggy driver is used for mounting), so I'd try checking the mount options for the share. 可能在Unix系统上未正确配置文件名编码(或使用错误的驱动程序进行挂载),因此我将尝试检查共享的挂载选项。 Details vary depending on the OS ("Unix" is pretty general). 具体细节因操作系统而异(“ Unix”相当普遍)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.