We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db6d1f2 commit e59fb22Copy full SHA for e59fb22
src/Message.php
@@ -962,6 +962,9 @@ private function encodeHeader($header, $value)
962
if (!$coding && $char === 61 && preg_match('/;(\s+)?([a-z0-9\-]+)(\s+)?(=(\s+)?\"[^\"]+)?/ui', $result)) {
963
$ascii = true;
964
}
965
+ if ($coding && $symbol === ' ') {
966
+ $ascii = false;
967
+ }
968
if ($ascii) {
969
if ($coding) {
970
$coding = false;
@@ -981,8 +984,13 @@ private function encodeHeader($header, $value)
981
984
$add += 3;
982
985
983
986
if ($position + $add >= $max) {
- $line = "=\r\n $line";
- $position = $add + 1;
987
+ if ($coding) {
988
+ $line = "?=\r\n =?utf-8?Q?$line";
989
+ $position = $add + 11;
990
+ } else {
991
+ $line = "=\r\n $line";
992
+ $position = $add + 1;
993
994
995
$result .= $line;
996
$position += $add;
0 commit comments