diff options
author | Reto Brunner <reto@labrat.space> | 2020-01-04 20:39:00 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-01-05 16:02:42 -0500 |
commit | 126119c0b1a5dc1da11c930769c03ff0a7f33fa8 (patch) | |
tree | c54492d8512108aecf2a2cf24cf24dfc2b3196f5 /widgets/msgviewer.go | |
parent | cb168682b3754e57e27d809e41d8c22bb56457af (diff) | |
download | aerc-126119c0b1a5dc1da11c930769c03ff0a7f33fa8.tar.gz |
msgviewer: decode headers prior to displaying them
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r-- | widgets/msgviewer.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index ff3bcb0..cc883fc 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -590,8 +590,14 @@ func (pv *PartViewer) attemptCopy() { // hence all writes in this block go directly to the pager fields := pv.msg.RFC822Headers.Fields() for fields.Next() { + var value string + var err error + if value, err = fields.Text(); err != nil { + // better than nothing, use the non decoded version + value = fields.Value() + } field := fmt.Sprintf( - "%s: %s\n", fields.Key(), fields.Value()) + "%s: %s\n", fields.Key(), value) pv.pagerin.Write([]byte(field)) } // virtual header |