Home >Backend Development >C++ >How Can I Validate File Names for Legality in Windows Applications?
When re -naming documents, ensure that the effectiveness of the target file name is crucial. In order to compatible with international character sets and Windows complex naming agreement, a powerful verification mechanism is required.
According to MSDN's files and directory naming guidelines, the legal Windows file name usually follows the following principles:Allowed characters:
Any character in the current code page (Unicode/Ansi 127) is allowed.
Special characters::, /,, |,?, * The character that represents the range between 0-31 (below ASCII space)
Use the "?" In front of the unicode file pathway to 32,000 characters, but it should be noted that the expansion of the directory component may exceed this limit.
The above is the detailed content of How Can I Validate File Names for Legality in Windows Applications?. For more information, please follow other related articles on the PHP Chinese website!