-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Wednesday, October 6 at 04:31 PM, quoth Matthias Apitz: >> It's because vim isn't *told* what character set the input file >> will be; it has to guess. Mutt is handing it a UTF-8 file (because >> mutt converts mail messages into whatever the local terminal >> character set is before handing it to any other program (such as >> vim), for obvious reasons). In UTF-8, the á character is >> represented as a two-byte character: 0xc3 0xa1. However, your vim >> is assuming that input files are in ISO-8859-1, and both of those >> bytes are valid ISO-8859-1 characters (this is the fundamentally >> impossible problem of determining character set from unidentified >> byte streams). As you might imagine, 0xc3 is Â, and 0xa1 is ¡. >... > >It is converted *before* it is stored into the temp file for 'vim'; I've >checked this with truss(1) what mutt hands over to vim (see the >^^^^marked bytes):
Well, of course it is. When mutt reads an email message, it reads it into it's own local memory, transforms it into a form that is convenient to think about (in this case, utf-8), and uses that to display to the terminal. Thus, it's pretty obvious why mutt would use that same source to write out files for vim. In other words, the file is written in utf-8 characters; it is not written in latin1 characters and then converted. But this is, I think, an irrelevant detail. The real point of the matter is that the file is in UTF-8 encoding by the time vim gets it. >g...@current:~> env | egrep 'LANG|LC_' >LANG=es_ES.UTF-8 Presumably, that's a valid LANG on your system. Just for giggles, make sure. Run locale -a | grep en_ES ~Kyle - -- A great many people think they are thinking when they are actually rearranging their prejudices. -- William James -----BEGIN PGP SIGNATURE----- Comment: Thank you for using encryption! iQIcBAEBCAAGBQJMrI0mAAoJECuveozR/AWet3kP/2ryZiNE75zuEopd+7XgY3ut r+ywAhxvmuJtpPEQG2S4jotGvKThuR77y7tzZr9MLEGOui+YRhzqvWY7bVxp2EO8 Qo9iwRxs8dZ/pm82n7UryhbHFIM4Jpkw2KHXT8Ud1pqufqH+qgzdNJEauTAAz05s q8GCCxYlL2uNJkRgUOQzsN3hOFfGDXwSCgMcy9k8khx9Gw5736ah5gRxZADgGhf5 r+wHONkFafbtvGRb3wQfNVRx1I+LXP6T5Z79S2FnIaC7LDp/4fWyOGL27H77v3qO QrgELodiyzlthR6D43WRDZ1cEVJ2a/3qLW8YdizomM3nTk7IXPtEpjYMD5GNAT+u iOiqIRSThaj6Hz8FGLCYRsu7uq9HNLSVmRQYlqPo1yaPCgREyOFrArRYY90WBueR tGFlxsKoJVRXu+vPfa73IwoyGPq+5aYjdtCpwQd4BgZw+/akf5ZbUVcoEnShZy4+ I5d25yhNfUj1TrbLV/oUxxPmw9exJnE6Acgr0Ce5Fz/lIrIkUR32gX7j6yRwYeLL FJkjIIJJbNu7r1tJYf12Vr0LFXp/Cp8w/epFauDdolOPhipVxx17scNWWq0SqnW2 2UrTr758IRYRskpi5/otaszejanCZ2d+7jeJutDHrGBsgSZNwMiYDO3zlmSZrVR5 ixUeEwaGsD+utJvdZ4Td =52rG -----END PGP SIGNATURE-----