如何在 Windows 中获取文件名中带有冒号的文件? [英] How to get a file in Windows with a colon in the filename?

查看:48
本文介绍了如何在 Windows 中获取文件名中带有冒号的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从上传文件名中带有冒号的文件的客户那里收到错误,即 C:/uploads/test : doc.html

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

我假设某些 Unix 或 Linux 系统正在生成文件,但我不确定用户如何使用无效的文件名保存它们.我编写了一段应该在上传时重命名文档的代码.我的问题是我无法测试它,因为我无法在 Windows 上获取文件名中包含冒号的文件.

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.

推荐答案

我发现了一个与冒号非常相似的字符,"꞉" 它是一个 Unicode 字符,称为修饰符字母冒号.这没有像全角冒号那样的空格,并且与常规冒号几乎完全相同,但该符号有效.您可以从上面复制并粘贴它,也可以使用代码点,U+A789

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

这篇关于如何在 Windows 中获取文件名中带有冒号的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆