Batanichek
Batanichek

Reputation: 7871

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?

Upvotes: 1

Views: 341

Answers (1)

Konrad
Konrad

Reputation: 18657

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.

Upvotes: 2

Related Questions