Replace all non-ASCII characters in a string by their ASCII equivalent
<p>Using Qt/C++, I need to generate a string with only a subset of ASCII characters : letters, digits, hyphen, underscore, period, or colon.</p>

<p>As input, I can have anything.</p>

<p>So I try to apply some rules :</p>

<ul>
<li>every QChar::isSpace will be replaced with an underscore</li>
<li>every non-ASCII letters will be replaced with an ASCII equivalent (example : "é"  will be replaced with "e")</li>
<li>every other non-ASCII character will be removed</li>
</ul>

<p>Is there any simple way with Qt/C++ to apply the 2nd and the 3rd rule ?</p>

<p>Thanks</p>