Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question
2  
Can you provide examples (e.g. screenshots, or copy/paste the name)? Is it only in Finder, or also in Terminal? –  Daniel Beck Feb 13 '12 at 20:01
    
Are the characters that are replaced by question marks special characters like accented characters, umlauts, characters in another language? –  Lars Kotthoff Feb 14 '12 at 17:53
    
@LarsKotthoff no, they appear to be spaces or non-breaking spaces, I'm not sure. –  Johnny Feb 15 '12 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 Feb 15 '12 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 Feb 16 '12 at 12:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.