简体   繁体   English

从Unix复制文件到Windows更改文件名

[英]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.

相关问题 将 jar 文件从 Windows 7 复制到 Unix 会产生 java.util.zip.ZipException - Copying a jar file from Windows 7 to Unix gives java.util.zip.ZipException 从Windows OS到Java中的Unix文件迁移 - file treansfer from windows OS to unix in Java 从Unix将文件写入Windows远程位置 - Write a file to a Windows remote location from Unix 重新转换txt文件(从Windows到Unix) - Reconversion txt file (from Windows to Unix) 通过Java将文件从Windows机器复制到另一个Windows机器 - Copying a file from a windows machine to another windows machine through java java中的文件类型(Windows,unix) - File type in java (Windows,unix) Windows背景中的Java,用于将文本从浏览器直接复制到文本文件 - Java in background of windows for copying text from the browser directly to text file 从HDFS复制文件到Windows计算机时出错 - Error while copying a file from HDFS to Windows machine 从Unix服务器到Windows的servlet中的ms word文件下载问题 - ms word file download issue in servlet from unix server to windows 如何自动定期将文件从Windows计算机上传到UNIX服务器? - how to automatically and periodically upload a file from a windows machine to a unix server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM