Closed djberg96 closed 2 years ago
This is now fixed at https://github.com/oracle/truffleruby/commit/199ad9507d6cd1192cab72028afd59590e74ab8a.
Note that this actually produces garbage entries:
$ ruby -e 'p Dir.foreach(Dir.pwd, encoding: Encoding::UTF_16LE) { |f| p f }'
"\x2E"
"\u2E2E"
"\u7073\u6365"
"\u494C\u4543\u434E\u2E45\u646D"
...
vs
$ ruby -e 'p Dir.foreach(Dir.pwd) { |f| p f }'
"."
".."
"spec"
"LICENCE.md"
...
i.e., using the encoding there only makes sense if it's actually the encoding of the filesystem, and I think no filesystem uses UTF16. I need to change the spec for TruffleString, so I'll use another encoding.
Ruby 3.0.2:
Truffleruby 22.0.0.2:
wrong number of arguments (given 2, expected 1) (ArgumentError)