Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I decode quoted-printable content to normal strings in node.js?

For example, I have a string "this=20is=20a=20string" that I want to convert to "this is a string".

Is there a library function or a npm module that does it or should I make my own function to do it?

like image 324
dan gibson Avatar asked Nov 01 '12 03:11

dan gibson


1 Answers

Use mimelib:

var mimelib = require("mimelib");
mimelib.decodeQuotedPrintable("this=20is=20a=20string") === "this is a string"
mimelib.decodeMimeWord("=?iso-8859-1?Q?=27text=27?=") === "'text'"
like image 83
dan gibson Avatar answered Sep 27 '22 00:09

dan gibson