[Qt-interest] removing specialcharacters for filenames

Alexander Poddey alexander.poddey at gmx.net
Wed Sep 2 20:58:30 CEST 2009


HI all,

is there a best practice for removing special characters, white space and so 
on when 'deriving'  filenames from QStrings?
I have a user provides string and want to derive a sane filename from that 
(ensuring that the preprocessed string will work as filename)

I found QString::simplified which remose all the ASCII 
characters '\t', '\n', '\v', '\f', '\r', and ' '.
But how about all the usually not used special characters in filenames?


alex






More information about the Qt-interest-old mailing list