Fix unicode handling in 'View HTML code as formated text'. Fixes #667 #679

Merged
enikesha merged 2 commits from htmlfix into master 2014-07-15 01:45:15 +02:00
Showing only changes of commit c848d55462 - Show all commits

View File

@ -2583,16 +2583,18 @@ class MyForm(QtGui.QMainWindow):
'''select message from inbox where msgid=?''', msgid)
if queryreturn != []:
for row in queryreturn:
messageAtCurrentInboxRow, = row
messageText, = row
lines = messageAtCurrentInboxRow.split('\n')
messageText = shared.fixPotentiallyInvalidUTF8Data(messageText)
messageText = unicode(messageText, 'utf-8)')
lines = messageText.split('\n')
for i in xrange(len(lines)):
if 'Message ostensibly from ' in lines[i]:
lines[i] = '<p style="font-size: 12px; color: grey;">%s</span></p>' % (
lines[i] = u'<p style="font-size: 12px; color: grey;">%s</span></p>' % (
lines[i])
elif lines[i] == '------------------------------------------------------':
lines[i] = '<hr>'
content = ''
content = u''
for i in xrange(len(lines)):
content += lines[i]
content = content.replace('\n\n', '<br><br>')