Create an application that complies with the naming specifications of the Windows file
Integrated file renames in the application need to verify whether the target file name specified by the user is in line with the Windows naming agreement. Although simple regular expressions are sufficient to verify, they ignore characters in specific languages, such as sound -changing symbols.
According to Microsoft's documents, the legal Windows file name follows the following general rules:
Forbidden characters:
,
,,
, "
, :
, /
|
The characters of the integer value intercity between 0-31 (ASCII space and below) ?
*
The character that does not support the file system (e.g., the ending of the end or the space) For the UNICODE path that uses prefix, the maximum length is 32,000 characters (note the potential overflow problem)
The above is the detailed content of How Can I Ensure My Application Creates Legally Compliant Windows File Names?. For more information, please follow other related articles on the PHP Chinese website!