[issue2564] UTF-8 encoding is destroyed by 'notify' in email subjects

Oleg Smolsky bugs at mercurial.selenic.com
Thu Dec 23 01:21:31 CST 2010

New submission from Oleg Smolsky <oleg at smolsky.net>:

The "Notify" extension has a bug around line 218 where it tries to shorten 
the subject by chopping symbols off the end. The code works correctly with 
plain English/ASCII yet breaks legitimate UTF-8 comments:

1) subject = subject[:maxsubject - 3] + '...' 
 - this line can cut in the middle of a multi-byte symbol 
 - the code can only work with ASCII

2) mail.headencode(self.ui, subject, self.charsets, self.test)
 - this call fails to detect encoding
 - and spits out bytes encoded/transcoded in some weird way

3) the final result - rubbish in email subjects

messages: 14739
nosy: os
priority: bug
status: unread
title: UTF-8 encoding is destroyed by 'notify' in email subjects

Mercurial issue tracker <bugs at mercurial.selenic.com>

More information about the Mercurial-devel mailing list