-R 上传文件名中包含西班牙字符的文件夹 returns 出错
-R uploading a folder with Spanish characters in file name returns an error
我正在尝试使用 gsutil 将包含文件(具有不同文件扩展名)的文件夹集合上传到我的存储桶。我正在使用以下命令:
gsutil -m cp -R -L dir gs://my_bucket
它可以正常上传文档,直到遇到包含 ó
等字符和其他西班牙字符的文件名 ("Opinió ITAE3"),然后出现此错误:
[Error 2] The system cannot find the file specified: u'C:\Users\anton\Desktop\Test\Test\Opinio\xb4 ITAE3.txt'
CommandException: 1 file/object could not be transferred.
许多文件都很旧。当我创建一个名称类似于 éóá.txt
的文件时,它工作正常。但它不适用于那个旧文件。好像跟编码有关系
如何将这些文件与其他文件一起上传?
如 Filename encoding and interoperability problems 的云存储文档所述:
Users with files stored in other encodings (such as Latin 1) must convert those filenames to UTF-8 before attempting to upload the files.
它建议:
If you have too many files for that to be practical you can use a tool to convert the old character encoding to UTF-8. One such tool is native2ascii.
我正在尝试使用 gsutil 将包含文件(具有不同文件扩展名)的文件夹集合上传到我的存储桶。我正在使用以下命令:
gsutil -m cp -R -L dir gs://my_bucket
它可以正常上传文档,直到遇到包含 ó
等字符和其他西班牙字符的文件名 ("Opinió ITAE3"),然后出现此错误:
[Error 2] The system cannot find the file specified: u'C:\Users\anton\Desktop\Test\Test\Opinio\xb4 ITAE3.txt' CommandException: 1 file/object could not be transferred.
许多文件都很旧。当我创建一个名称类似于 éóá.txt
的文件时,它工作正常。但它不适用于那个旧文件。好像跟编码有关系
如何将这些文件与其他文件一起上传?
如 Filename encoding and interoperability problems 的云存储文档所述:
Users with files stored in other encodings (such as Latin 1) must convert those filenames to UTF-8 before attempting to upload the files.
它建议:
If you have too many files for that to be practical you can use a tool to convert the old character encoding to UTF-8. One such tool is native2ascii.