Since this is homework, I assume that your teacher knows and knows nothing about UTF-8 and was probably stuck in the 1980s with “code pages” and “advanced ASCII” (words that you should remove from your vocabulary, if you have not already done so). Your teacher probably wants you to write a 128-byte lookup table that displays the bytes CP437 or Windows-1252 in the range 128-255 for similar ASCII letters. It will be like ...
void strip_accents(unsigned char *dest, const unsigned char *src)
{
static const unsigned char lut[128] = { };
do {
*dest++ = *src < 128 ? *src : lut[*src];
} while (*src++);
}
R .. source
share