+# this is a weird behavior for different perl versions, 5.12 warns twice,
+# which is correct since we do the encoding thing twice, for Subject
+# and Data respectively.
+# but 5.8 and 5.10 warns only once.
+ok( @warnings == 1 || @warnings == 2, "1 or 2 warnings are ok" );
+ok( @warnings == 1 || ( @warnings == 2 && $warnings[1] eq $warnings[0] ),
+ 'if there are 2 warnings, they should be same' );
+
+like(
+ $warnings[0],
+ qr/\QEncoding error: "\x{fffd}" does not map to iso-8859-1/,
+"We can't encode something into the wrong encoding without Encode complaining"
+);
+