Text Escaping and Unescaping in JavaScript with strutil

Today the package strutil came in handy, after receiving (*) this UTF-8 Quoted Printable text in my hands:


Thanks to strutil#unescapeFromMime() I was able to regain the original string:

Test 👻

Upon further investigation of strutil it turns out that this package is really powerful as it can do a truckload of things when it comes to encoding:

Text Escaping and Unescaping in JavaScript (UTF-8, UTF-16, UTF-32, dec, hex, punycode, mime, base64, and more)

jsescape demo →

(*) The encoding in the first place itself happened automatically by Amazon, whilst storing User-Defined Metadata on an S3 Object:

User-defined metadata is a set of key-value pairs. Amazon S3 stores user-defined metadata keys in lowercase. Each key-value pair must conform to US-ASCII when using REST and UTF-8 when using SOAP or browser-based uploads via POST.

Now you know 😉