AndyUKG said:
I have checked the output via hexdump, it all looks good. I can see that "á" is outputting to "c3 a1".
That's good. If you look up the UTF-8 encoding (wikipedia for UTF-8), you will see that code points up to 11 bits are encoded as 110xxxxx 10xxxxxx. Which exactly matches the bit pattern of c3 a1, which is 11000011 10100001. So the resulting character is (putting together all the x's from above) 00E1. Which is good: If you look at the Unicode table, character 00E1 is a lowercase a with the accent going to the right (exactly the character you have in your message, which I can't reproduce on my US keyboard). So we have verified that date (and therefore sendmail) are really outputting UTF-8.
However as described previously, in an interactive shell and in Sendmail mail out put this instead displays as "á",
Also makes sense, if you assume that the putty is running in iso-8859-1 (or some close relative, like -15). If you look at the code table (again, Wikipedia is your friend), the character 0xc3 is an uppercase A with a twiddle on top, and 0xa1 is an upside-down exclamation mark.
So the problem is understood: You are running your system in UTF-8, but then your display program (namely putty) is configured (should I say mis-configured?) to run in iso-8859-1 (or something similar).
Easiest thing to do: try to configure your putty to be running in UTF-8. Unfortunately, I don't have a windows machine with putty around any more, so I can't tell you how to configure it's display character set. I just tried it on my macintosh though (where the terminal emulation program of choice is called "iTerm", and the character set is in Preferences -> Profiles -> Terminal): If I configure it to display UTF-8, and execute the following python line:
print chr(0xc1) + chr(0xa1), it prints a lowercase a with accent. If I then configure iTerm for "Western ISO Latin 1", then I get the uppercase A with twiddle plus upside-down exclamation mark.
So, step 1: Fix your terminal emulator to match your system.
Step 2: Think about whether putting non-ASCII characters into sendmail is a smart move. You are RELYING on all of your audience having their terminals configured for UTF-8. And I mean ALL of your audience. While this is a beautiful vision for the future (I would love for all encodings other than UTF-8 to vanish from the face of the earth, and I'd be happy to donate a few boxes of ammo and my shooting skills to further that goal), the world isn't ready for that yet.