Re: utf8 file corruption after transmission over email
On Fri, May 08, 2009 at 06:23:15PM -0700, zion wrote:
> On Fri, May 08, 2009 at 04:34:14PM -0700, zion wrote:
> > Well, I just captured smtp session of loopback interface (same box where
> > mutt is running). Here is the relevant part:
> > 03d0: 746f 3e38 353c 2f74 6f3e 0d0a 0909 093c to>85</to>.....<
> > 03e0: 7265 6164 3e21 d091 e288 9ae2 9591 3c2f read>!п.Б..Б..</
> > ^^^^ ^^^^ ^^^^ ^^^^
> > 03f0: 7265 6164 3e0d 0a09 0909 3c77 7269 7465 read>.....<write
> >
> > As you can see, this character is already messed up before reaching
> > server. So, @gmail is not guilty here ;-).
> Turns out it's my locale. having this causes the problem:
> LC_CTYPE=ru_RU.KOI8-R
> if LC_CTYPE is unset, file doesn't get corrupted.
I think mutt is reading your file, assuming it's KOI8-R as stated in
your locale, and converting it to UTF-8 for sending.
It has to do that; plain text won't tell it what charset it's in and it
has to guess. If you want to send files over email byte-per-byte, renaming
them to .bin or something else that has the mime type of
application/octet-stream should work better.
--
Jussi Peltola