有关在Windows中阅读日语文件名的问题

发布于 2025-02-12 11:35:31 字数 604 浏览 0 评论 0原文

我有一个带有日语文件名的文件,需要读取

202112_10エリア計.csv

它在Windows PC上正常工作,我只需要阅读它:

pd.read_csv (file_path+'202112_10エリア計.csv')

但是,当我尝试在github Action上使用它时(仍然是Windows EnviroMent) 它有错误:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\202112_10\u30a8\u30ea\u30a2\u8a08.csv'

所以,我认为这是因为github动作无法阅读日语角色 我想在阅读它之前对其进行编码

csv_name = csv_name.decode('utf-8')

,然后再次出现错误,

AttributeError: 'str' object has no attribute 'decode'

所以我想知道是否有人可以帮助我实现这一目标?提前致谢:)

I have a file with japanese file name need to be read

202112_10エリア計.csv

it works fine on my windows pc, i just need to read it by:

pd.read_csv (file_path+'202112_10エリア計.csv')

however, when i was trying to use it on Github Action(still windows enviroment)
it got error:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\202112_10\u30a8\u30ea\u30a2\u8a08.csv'

so, i think its because github action can not read japanese character
and i want to encoding it before read it

csv_name = csv_name.decode('utf-8')

and it got error again

AttributeError: 'str' object has no attribute 'decode'

so i was wondering if someone could help me achieve this? thanks in advance:)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文