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'd really like to use characters like "?" in Windows for filenames. I understand why they are reserved, but why haven't they, or will they ever circumvent this by using unicode characters that look the same but (obviously) have different Unicode codes?

I think is entirely possible, but if not, why?

share|improve this question
add comment

3 Answers 3

I think the reason they aren't is because of the potential to cause confusion. If you have a character that looks like a "?" but has a different unicode code - how will you tell the difference?

How would you explain it to someone? "You can't have a question-mark in your filename, but you can have a thing-that-looks-like-a-question-mark-but-isn't, and to type it you only need to use this 5-key combination."?

Better (in my opinion) to exclude them completely and avoid mistakes.

share|improve this answer
    
A normal user shouldn't encounter that problem, programmers should. Programs like Windows Explorer would automaticaly use the lookalike intead the real "?". Other programs can tell a Windows API that certain field is for filenames so it replaces the characters with lookalikes. Copying text with lookalikes would replace them with the real ones. Most people are not programmers and never use wildcard characters. –  Carlos Gil Sep 7 '11 at 17:59
    
Wouldn't it be better then to use the unicode characters as the wildcards? Less confusion for everyone else and no worrying about whether a particular program implements this strategy, and since programmers are already familiar with unicode, not such a big deal for them to use unicode chars for wildcards. –  bfhd Sep 7 '11 at 21:07
add comment

You can use those characters now yourself. But I'm assuming you mean to have the operating system automatically transliterate between an ASCII question mark, for example, and a lookalike such as ﹖ (SMALL QUESTION MARK - UFE56). I really don't think that's satisfactory, especially since Linux and others, where the only invalid characters for filenames are slash (/) and null (ASCII 0), accept those characters readily.

Further reading:

share|improve this answer
add comment

The characters that are not allowed in a file name are:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)

according to Microsoft Naming Conventions.

Is that what you were referring to?

The reason is probably because it would be too hard to deal with files with those characters in them in the old command.com shell, e.g. ? also means any one character, * also means any file, etc.

Rather than teach everyone how to handle those special cases, they disallowed it, making it easier to script.

There wouldn't be Unicode equivalents for those characters, and if there was an equivalent, it still wouldn't solve that problem: the existing ASCII ? and * would still have to work as wildcards, otherwise everyone would have to re-write their scripts.

share|improve this answer
1  
Note that most of those restrictions are in the Windows API layer. The file system itself couldn't care less and in fact, NTFS can also support POSIX file name semantics. –  Joey Feb 4 '11 at 0:11
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.