2

I have a number of files on my Mac whose names suddenly started containing question marks.

When I examine them in Windows, they look fine. Same if I fire up the Ruby interactive shell (irb) and examine them in UTF8 mode.

Any ideas on how to get rid of the question marks?

Update 1: here's a screen capture of Finder with some file names with question marks. enter image description here

Update 2: An example of a bad file name is: Mac? ?users.Output of locale is:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Examining the above file name in ruby interactive shell with filename.bytes{|c| puts c} yields:

77
97
99
226
128
173
32
226
128
172
117
115
101
114
115
9
  • 3
    Can you provide examples (e.g. screenshots, or copy/paste the name)? Is it only in Finder, or also in Terminal?
    – Daniel Beck
    Commented Feb 13, 2012 at 20:01
  • Are the characters that are replaced by question marks special characters like accented characters, umlauts, characters in another language? Commented Feb 14, 2012 at 17:53
  • @LarsKotthoff no, they appear to be spaces or non-breaking spaces, I'm not sure.
    – Johnny
    Commented Feb 15, 2012 at 19:38
  • How does it look like in Terminal when you run ls, and what is the result of editing a file name, copying it, and pasting it into a text document? Then save, and view in a hex editor. What is the byte sequence where that character is?
    – Daniel Beck
    Commented Feb 15, 2012 at 20:01
  • Running 'ls' shows the file names still with question marks. So does copy pasting the file name. The byte sequence at the question mark is always 3F, which makes sense since that's a question mark in ASCII. Could this be a result of Finder failing to correctly interpret UTF8?
    – Johnny
    Commented Feb 16, 2012 at 12:47

0

You must log in to answer this question.

Browse other questions tagged .