Page 1 of 1
Replace invalid characters under NTFS
Posted: 22 Jan 2014 18:15
by Marco
As we all know, there's a bunch of characters which aren't allowed in NTFS filenames in the Win32 namespace. I searched for a replacement for each of them (
[1],
[2]):
Code: Select all
\ → \
/ → ⁄,/
: → ꞉
* → ٭
? → ?
" → "
< → <
> → >
| → ǀ
Now, "sanitizing" any string before using it as a filename is as trivial as applying a replacelist(), namely
Code: Select all
$string = replacelist($string, '\,/,:,*,?,",<,>,|', '\,/,꞉,٭,?,",<,>,ǀ');
But
I wonder if any of you know of better, more graphically pleasing replacements. Here are a couple of screenshots with the two fonts used by Windows, Tahoma (XP) and Segoe UI (Vista and later).
Re: Replace invalid characters under NTFS
Posted: 22 Jan 2014 18:41
by admin
Cute idea! (Although such filenames might trigger panic attacks in some users...)
Re: Replace invalid characters under NTFS
Posted: 22 Jan 2014 18:49
by Marco
Ahah, like curses in certain comic strips: ahr ahr grr @#+!!
Anyway, I can think of youtube videos and webpage titles: both of them can be saved, and both of them can contain such characters. Replacing them with the usual hyphen or underscore might be viable for asterisks and colons, but quotation and question marks often have an important meaning in sentences.
Re: Replace invalid characters under NTFS
Posted: 22 Jan 2014 18:53
by admin
Marco wrote:Ahah, like curses in certain comic strips: ahr ahr grr @#+!!.
I rather thought: When I'd see a filename with a "?" on my machine I'd think it's defect.

Re: Replace invalid characters under NTFS
Posted: 22 Jan 2014 18:58
by TheQwerty
I genuinely
love the idea, but dislike the difficulty it brings to typing the names.
I suppose with an AHK script to put your keyboard in NTFS-safe-mode it might not be so bad.

Re: Replace invalid characters under NTFS
Posted: 29 Jan 2014 15:23
by binocular222
Here is the AHK꞉
Code: Select all
\::Sendinput {U+FF3C}
/::Sendinput {U+2044}
+;::Sendinput {U+A789}
+8::Sendinput {U+066D}
+/::Sendinput {U+FF1F}
+'::Sendinput {U+FF02}
+,::Sendinput {U+FF1C}
+.::Sendinput {U+FF1E}
+\::Sendinput {U+01C0}
All the Hex code is looked up from
http://slayeroffice.com/tools/unicode_lookup/