Question

I'm using a MacBook Pro with Catalina 10.15.7 and keyboard is set to UK English.

I made a folder, mytest on Desktop, and the file test.html with CSS.

The character in question is https://www.compart.com/en/unicode/U+002F

I can use the character in HTML with no problems, but for filenames it's a bit more of a problem.

It's a test file, so not for public viewing or usage and wouldn't be in production files anyway.

I've done some light Google-ing, but would appreciate the help as I'm not sure; the only reason for this is simply to learn a bit more about something that I've learnt in HTML (characters / unicode).

Can I name a file with the unicode solidus with the name test/mytest/2021.html ?

Was it helpful?

Solution

Unicode U+002F is equivalent to ASCII 47, or the "slash"/soldus key on your keyboard. Calling it a Unicode special character is a bit like maître Pathelin in the medieval farce discovering that he was speaking prose; it's just the unmodified output of the key next to the right shift key.

It's not so much that it's a Unicode special character as that it's a special character in the operating system. MacOS has long had a complicated relationship with the slash and colon symbols in path names.

In the command line, / is treated as the directory separator, and cannot be used in filenames. In the Finder, : has been used as the directory separator. A file with a : in its name will display as a / in the Finder, but may produce problems with some program's name safety checks.

If you type at the terminal prompt touch ~/Desktop/test:mytest:2021.html, that file will appear on your desktop as test/mytest/2021.html, but not all programs might be happy about it.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top