From earlier posts and experience, you know:
A 4th point might be unfamiliar: if you choose to Q-encode an entire sentence, a few characters that used to not require encoding suddenly do!
Those are the reserved characters in Q-encoding: =
?
_
plus spaces and tabs. Like the spec says:
Such was the problem encountered by a Nation user who was trying to use the Lightbulb emoji 💡. They got the emoji itself right, but they added a question mark and space inside the encoded word[1] and forgot to encode those:
=?UTF-8?Q?Schon gewusst? =F0=9F=92=A1 Spannende Insights?=
(Not sure exactly how they assembled this Subject line, by the way — probably hand-editing, which is prone to error!)
But here’s the notable part: the problem only revealed itself in Apple Mail for iOS. If you don’t test in that client, you won’t know how bad it looks:
Apple is absolutely correct that it’s bad Q-encoding, and they’re right to break the display. Other mail clients are more forgiving, but you should always build to the strictest standard and don’t rely on clients being looser.
We know that this is wrong:
=?UTF-8?Q?Schon gewusst? =F0=9F=92=A1 Spannende Insights?=
But what’s right? Well, it depends on how much you want to put between the =?
and ?=
.
Option A: If you want to keep encoding the whole Subject without taking any shortcuts, do it like this, with =3F
for the question mark and =20
for the space:
=?UTF-8?Q?Schon=20gewusst=3F=F0=9F=92=A1=20Spannende=20Insights?=
Option B: If you want to encode the whole Subject but use the special shortcut _
for the space to increase readability:
=?UTF-8?Q?Schon_gewusst=3F=F0=9F=92=A1_Spannende_Insights?=
Option C: Just encode the emoji, move everything else outside:
Schon gewusst? =?UTF-8?Q?=F0=9F=92=A1?= Spannende Insights
Whether you choose A, B, or C, you’ll get the right result:
[1] “Encoded word” is the technical name for the characters between =?
and ?=
. Regardless of whether it’s a single emoji or multiple words in regular parlance, it’s still called a “word” in Q-speak.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.