Thank you, senior. I don't know if I'm asking too many questions and causing harm to people who are trying to get the information they need from comments. Can I ask one more question?
My senior said, "The regional settings of the operating system or compiler may affect character interpretation. Make sure the regional settings (locale) are consistent between environments."
From the information I got, in UTF-8 'Í' is represented by two bytes: 0xC3 0x8D. However, in ISO-8859-1 (Latin-1), 'Í' is represented as the single byte 0xCD.
Then, if I want to use the code in a UTF-8 encoding environment, can I change it as follows?
if (len > 8 && tmp1[0] != '\xCD')
fprintf(fp, "\t%s\t%s\n", tmp1, tmp2);
else if (tmp1[0] != '\xCD')
fprintf(fp, "\t%s\t\t%s\n", tmp1, tmp2);