How can you change all accented letters to normal letters in C++ (or in C)?
By that, I mean something like eéèêaàäâçc
would become
Here is what you can do using ISO/IEC 8859-1 (ASCII-based standard character encoding):
192 - 197
replace with A
224 - 229
replace with a
200 - 203
replace with E
232 - 235
replace with e
204 - 207
replace with I
236 - 239
replace with i
210 - 214
replace with O
242 - 246
replace with o
217 - 220
replace with U
249 - 252
replace with u
Supposing x is the code of the number, perform the following for capital letters:
y = floor((x - 192) / 6)
y <= 2
then z = ((y + 1) * 4) + 61
else z = (y * 6) + 61
Perform the following for small letters:
y = floor((x - 224) / 6)
y <= 2
then z = ((y + 1) * 4) + 93
else z = (y * 6) + 93
The final answer z
is the ASCII code of the required alphabet.
Note that this method works only if you are using ISO/IEC 8859-1.