【问题标题】:Can Ruby 1.9.1 finally get a list of filenames if the filenames have unicode characters on Windows?如果文件名在 Windows 上具有 unicode 字符,Ruby 1.9.1 最终能否获得文件名列表?
【发布时间】:2011-03-08 18:11:20
【问题描述】:

如果文件名在 Windows 上具有 unicode 字符,Ruby 1.9.1 最终能否获得文件名列表?

我回想在 Ruby 1.8.6 和 1.8.7 时代,这在 Windows 上是不可能的。

【问题讨论】:

    标签: ruby unicode utf-8 internationalization


    【解决方案1】:

    Ruby 1.9.2/YARV 1.9.2 大大改进了 Windows 上的非 ASCII 文件名支持。您可以在 bug #1685: Some windows unicode path issues remain 中阅读所有相关信息。

    但是,如果您没有遇到任何错误,它仍然有可能在 1.9.1 上为您工作。

    【讨论】:

    • 我知道有人在 Windows 上使用cmd /U /C dir /B 来模拟它...但 Ruby 1.8.7 使用它表现得更好。 Ruby 1.9.1 将 0x0a 更改为 0x0d 并弄乱了 UTF-16
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 2013-11-08
    • 2019-09-30
    • 2015-11-19
    • 1970-01-01
    • 1970-01-01
    • 2012-03-13
    相关资源
    最近更新 更多