jetmore / swaks

Swaks - Swiss Army Knife for SMTP
http://jetmore.org/john/code/swaks/
GNU General Public License v2.0
848 stars 86 forks source link

Character issue in 20201010.0 #25

Closed jetmore closed 3 years ago

jetmore commented 3 years ago

User reported that utf8 strings that worked fine in 20190914.0 are now broken in 20201010.0. Still collecting data, just opening this as a placeholder

jetmore commented 3 years ago

gen2.sh.txt

Attached script demonstrates issue on Debian 10.5 system running perl 5.28.1. Reporter was also reproducing on Debian and Devuan systems. Requires locale cs_CZ.UTF-8 (though original reporter is using cs_CZ.utf8(?)). Not reproducible on macOS 10.15.6 using either the system perl (5.18.4) or homebrew's latest (5.32.0)

jetmore@g3:~/Documents/git/swaks/tmp$ ./gen2.sh
OLD = /home/jetmore/Documents/git/swaks/tmp/swaks.20190914.0, swaks.20190914.0 version 20190914.0
NEW = /home/jetmore/Documents/git/swaks/tmp/swaks.20201010.0, swaks.20201010.0 version 20201010.0
test 1 (--dump):
0a1
> Wide character in print at /home/jetmore/Documents/git/swaks/tmp/swaks.20201010.0 line 67.
3c4
< Date: Tue, 13 Oct 2020 07:20:37 -0400
---
> Date: Út, 13 říj 2020 07:20:37 -0400
6,8c7,9
< Subject: klíč Žluťoučký kůň
< Message-Id: <20201013072037.026235@g3.local>
< X-Mailer: swaks v20190914.0 jetmore.org/john/code/swaks/
---
> Subject: klíč Žluťoučký kůň
> Message-Id: <20201013072037.026238@g3.local>
> X-Mailer: swaks v20201010.0 jetmore.org/john/code/swaks/
10c11
< klíč Žluťoučký kůň
---
> klíč Žluťoučký kůň
test 3 (--dump, --data):
jetmore commented 3 years ago

bisected to 434f494abcc3558c73efc0e57a4338adeb402253, which introduced the localized Date: header that I thought was irrelevant (this explains the seemingly inexplicable - why using a custom --data prevented the error. The data I was using didn't have the Date header in it). However, fix for localized Date (3a95aa0498922a8a9591dda0da363f0e49b57086) also doesn't seem to work on Debian. Need to look at this when I have more time.