Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a file in Windows with a colon in the filename?

I am getting errors from customers who are uploading files with a colon in the file name, i.e. C:/uploads/test : doc.html

I assume that some Unix or Linux system is generating the file but I'm not sure how the users are saving them with the invalid filename. I have coded a piece that should rename the document on upload. My problem is that I can't test it because I can't get a file on Windows that has a colon in the filename.

like image 430
David Avatar asked Apr 30 '12 15:04

David


People also ask

Is colon allowed in filename Windows?

On Windows systems, files and directory names cannot be created with a colon (:). But if a file or directory name is created with a colon on a Linux or Mac operating system, then moved to a Windows system, percent encoding is used to include the colon in the name in the index.

How do I get special characters in a filename?

Type filename:*& to Explorer search field, this finds all files where the & character appears in the filename or file extension.

What can I use instead of colon in filename?

Most of the alternative glyphs with the word 'colon' in the description are decidedly unattractive as a colon replacement ( ˸ , ܄ , ﹕ , ᠄ , : , ︓ , and ꞉ ). There is another alternative that at least has a similar character width to the original colon - the mathematical symbol for a ratio: ∶ .


1 Answers

I found a very similar character to a colon, "꞉" it is a unicode character called a Modifier Letter Colon. This has no space like the fullwidth colon and is pretty much exactly the same as a regular colon but the symbol works. You can either copy and paste it from above or you can use the code point, U+A789

like image 68
Jack Avatar answered Sep 28 '22 03:09

Jack