encodeURI.js
URI encoding with support for character encoding.
There are other URL encoders that supports character encoding but I couldn't find one that honors the Unreserved Characters in RFC 3986.
Uses ES6 features. Has been used with AWS Lambda (v4.3.2).
Install
$ npm install encodeuricharenc
Usage
var encURI = ; // The only encoding for encodeURIComponent() is UTF-8 var str = "Smörgåsbord"; var utf8Encoded = ; // Sometimes you need another encoding var iso88591Encoded = ; console; // Sm%C3%B6rg%C3%A5sbord console; // Sm%F6rg%E5sbord
TODO
- Decoding
- Tests