fs: can't require non-ASCII file paths in Shift-JIS filesystem

未关闭
#56,670 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, nodejs

调研方向

从 fs 子系统开始,在使用 Shift-JIS 文件系统的 Japanese Windows 上重现所描述的简单 require 情况,然后将其与 ASCII 路径和非 Shift-JIS 系统进行比较。链接的可复现 repository 和 REPL 情况提供了起始示例。当 require 能够在 Shift-JIS 下成功加载非 ASCII 路径,且没有出现所报告的进程退出时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

fs never-stale windows
Version

v22.13.0, v23.6.0

Platform
Microsoft Windows NT 10.0.26100.0 x64
Subsystem

fs

What steps will reproduce the bug?
  1. Use Japanese Windows with Shift-JIS (aka CP932)
  2. Load a non-ASCII file path with require such as ヘルプ.js
How often does it reproduce? Is there a required condition?

Always reproduceable under a Shift-JIS filesystem.

What is the expected behavior? Why is that the expected behavior?

The file is loaded correctly.

What do you see instead?

"Process exited with code 3221225477"

Additional information
  • May be similar to https://github.com/nodejs/node/issues/56049, although it's an issue for a different method and doesn't mention the Shift-JIS requirement.
  • The issue was found in https://github.com/sapphiredev/pieces/issues/460 for reference, which used require in the user's case, the aforementioned issue also links a reproducible example repository, although not a minimal one for testing purposes, the issue has been reproduced with a simple require in REPL as well.
  • The same code works fine:
    • If the filesystem isn't Shift-JIS (UNIX, non-Japanese Windows).
    • ASCII names are used instead.
    • When run with an alternative runtime such as Deno.
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nodejs/node 的其他 Issue

查看 nodejs/node 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。