email.charsets trouble

Christian Ebert blacktrash at gmx.net
Mon Dec 1 04:11:12 CST 2008


Hi Giorgos,

* Giorgos Keramidas on Sunday, November 30, 2008 at 01:03:57 +0200
> I recently had a chance to upgrade the Hg installation at hg.hellug.gr
> to a crew snapshot.  One of the repositories hosted there is the common
> `translation tree' of the Greek FreeBSD documentation team at:
> 
>    http://hg.hellug.gr/freebsd/doc-el/
> 
> With older versions of Hg we would get commit email notifications whose
> included patches did not have a charset/encoding.  The rest of the email
> was really encoded with email.charsets = iso-8859-7 though, so most
> mailers would correctly infer that the patch was iso-8859-7 too.
> 
> With the recent Mercurial installation, patchbomb seems to be using
> utf-8 as the email charset, no matter what I try to use in the
> `.hg/hgrc' file of the relevant repository.
> 
> Most of the patches we commit in the Greek documentation are encoded in
> iso-8859-7, so they show up as a long list of question marks in the
> emails sent by patchbomb, i.e.:

[...]

> This means that patch email is not really useful to reviewers.  Is there
> any way to _force_ patchbomb to use a specific charset for the patch
> parts of the emails?
> 
> I have tried setting:
> 
>  [email]
>  charsets = iso-8859-7
> 
> but this always picks utf-8 for the outgoing emails.

I believe this is because your server runs in utf-8 locale.

So, there are the following bugs:

1) documentation (hgrc 5): an ui.encoding setting doesn't exist
2) ui.fallbackencoding is not consulted
   (but probably should be over util._fallbackencoding)

atm, only $HGENCODING (util._encoding derived from locale) and
util._fallbackencoding tried for _input_.

I will try to fix this and find a better way of chosing an input
charset -- hopefully without breaking other stuff (is it save eg.
to select web.encoding? etc.)

For the moment you could fix this eg. by setting

os.environ["HGENCODING"] = "iso-8859-7"

in hgweb(dir).cgi -- that is, if you can, and you don't have
other repos there that need a different setting. There might be
other ways too, but this should definitely be fixed in a clean
way.

Sorry about this, but the use case of notifications from a repo
"run" in a charset that differs from locale did not come to my
mind.

c
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
Ein deutscher Western/A German Western
-->> http://www.blacktrash.org/underdogma/ccc.html
-->> http://www.blacktrash.org/underdogma/ccc-en.html


More information about the Mercurial mailing list