andris9/mimelib — pull request #11 by snakamura (2012-07-23 07:10:52+00:00)
Title: Fixed passing a surrogate pair to encodeQuotedPrintable threw a URIError.

Passing a surrogate pair to `encodeQuotedPrintable` threw a `URIError` because it passed individual words to `encodeURIComponent`.

For example,

encodeQuotedPrintable('\udbba\udf04')

throw a `URIError` because it finally called `encodeURIComponent('\uddba')`, which threw a `URIError`.

This patch changed encodeQuotedPrintable to treat surrogate pairs specially and pass them to encodeURIComponent as a pair.