1

I am using the Ruby mail library https://github.com/mikel/mail/

I am looking for a solution to decode Quoted-printable strings (using this library or natives Ruby function)

My Ruby version is ruby 1.9.2p294

Any solution in Javascript from client side is also good.

Any clue?

3
  • 1
    Did you mean to tag this encoding instead of encryption maybe? Commented Jul 19, 2012 at 11:51
  • Example input/output would help Commented Jul 19, 2012 at 14:46
  • I use the gmail gem. When I get emails, sometimes they are in "Content-Transfer-Encoding: quoted-printable", example: "=EC=95=88=EB=85=95=ED=95=98=EC=84=B8=EC=9A=94!" this is "Hello" in Korean = 안녕하세요 Commented Jul 20, 2012 at 3:12

1 Answer 1

2

You will be able to decode it by decodeURIComponent(str.replace(/=/g,'%'))

Test code in Javascript:

var input = 'Hello! in Korean is: =EC=95=88=EB=85=95=ED=95=98=EC=84=B8=EC=9A=94!';
var output = decodeURIComponent(input.replace(/=/g,'%'));

document.writeln(output);

Output:

Hello! in Korean is: 안녕하세요!

Try this code online here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.