Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: Gmail eats Python Date: Sun, 26 Jul 2015 08:01:09 +0300 Organization: A noiseless patient Spider Lines: 55 Message-ID: References: <201507251634.t6PGYUvo028820@fido.openend.se> <87d1zgyqgb.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="31225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fJIq7SI4T4LXjqX2lYtds/lE47SmpQoI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:7O4753voehh9nslnx7fEMbe77dE= sha1:8R59BMgIHQ0v9Nha+K9RMmV6PpE= Xref: csiph.com comp.lang.python:94591 Marko Rauhamaa writes: > Jussi Piitulainen writes: >> Just in case anyone cares, Gnus shows me those indentations as octal >> codes, \302\240\302\240 (followed by one ASCII space). I guess a >> \302\240 is a NO-BREAK SPACE in UTF-8, and I guess Gnus does not know >> this because there is no charset specification in the headers. That >> seems to be missing whenever I see these codes instead of properly >> rendered characters and bother to check the headers. > The gnus command > > C-u g > > displays the raw message. Thanks! I was just typing t to see what I thought were the full headers. > It demonstrates that the posting was sent as > > Content-Type: multipart/alternative; boundary=001a1134d474c99321051bb5ef45 > > The first part has: > > Content-Type: text/plain; charset=UTF-8 > > The second part has: > > Content-Type: text/html; charset=UTF-8 > Content-Transfer-Encoding: quoted-printable Yes, with C-u g, I see them. > The text/plain variant expresses the indentations with plain > whitespace (SPC) characters. However, the text/html variant has: > >

=C2=A0=C2=A0 >>> def test(): pass
> =C2=A0=C2=A0 ...
> =C2=A0=C2=A0 >>> print('Hi world')
> =C2=A0=C2=A0 Hi world
> =C2=A0=C2=A0 >>>

> > =C2=A0 stands for '\u00a0' (NO-BREAK SPACE). I suppose that's a valid HTML fragment when the charset is declared, but the Gnus version I use fails to use the charset information when it renders the message. Annoying that it chooses text/html over text/plain and then fails. (Probably I can customize it now that I have a precise idea of what it is that is going wrong.) > When I have Gnus display the HTML variant, the indentation is not > displayed at all. I don't know why. So many ways to fail :)