Batanichek Batanichek - 7 days ago 7
R Question

Encode quoted-printable email in R

Is there package or function for encode quoted-printable text from email using R?

For example

Content-Type: text/plain; charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

=CA=EE=EB=EB=E5=E3=E8!


How can I get string ="Коллеги!" in R?

Answer

The Encoding from the base package should do the job. For example:

x <- "fa\xE7ile"
Encoding(x)
Encoding(x) <- "latin1"
x

would return:

[1] "façile"

Your text from email would be simply a string vector so you can encode it as you please.