From: thomas@... Date: 2014-07-28T08:02:42+00:00 Subject: [ruby-core:64094] [ruby-trunk - Bug #9712] Dir.entries replace Unicode character with questionmarks Issue #9712 has been updated by Thomas Thomassen. As mentioned the documentation for version 2.0 is missing this. SketchUp 2014 embedded Ruby 2.0 and developers usually refer to the documentation for the version embedded. Any chance to see that documentation updated? It's causing a bit of confusion and issues. Zachary Scott wrote: > I think the current documentation explains this well, so closing. > > ``` > /* > * call-seq: > * Dir.entries( dirname ) -> array > * Dir.entries( dirname, encoding: enc ) -> array > * > * Returns an array containing all of the filenames in the given > * directory. Will raise a SystemCallError if the named > * directory doesn't exist. > * > * The optional enc argument specifies the encoding of the directory. > * If not specified, the filesystem encoding is used. > * > * Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"] > * > */ > ``` ---------------------------------------- Bug #9712: Dir.entries replace Unicode character with questionmarks https://bugs.ruby-lang.org/issues/9712#change-48106 * Author: Thomas Thomassen * Status: Closed * Priority: Normal * Assignee: Zachary Scott * Category: doc * Target version: current: 2.2.0 * ruby -v: ruby 2.2.0dev (2014-04-07 trunk 45528) [i386-mswin32_100] * Backport: 2.0.0: DONTNEED, 2.1: DONTNEED ---------------------------------------- My basis when testing this is that I have a computer with English OS - codepage Windows-1252. The tests might yield different result if the Windows codepage is different - so please pay attention to that if you are unable to reproduce. Given a folder named "Foo" which contains a sub-folder "���������" ("\u3066\u3059\u3068") Dir.entries("Foo") will return: [".", "..", "???"] The characters that doesn't fit my filesystem codepage is translated into question marks. I would have expected the strings returned to be in some Unicode format. -- https://bugs.ruby-lang.org/