canceraiddev / elm-aws-core / AWS.Uri

Helper functions for encoding URIs.

AWS encodes more characters than encodeURIComponent does, so a special implementation is needed.

Helpers

percentEncode : String -> String

We don't use Url.percentEncode because it misses some characters. It uses the native encodeURIComponent under the hood:

encodeURIComponent escapes all characters except the following:
alphabetic, decimal digits, - _ . ! ~ * ' ( )

- from https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent

For AWS only "Unreserved Characters" are allowed. See http://tools.ietf.org/html/rfc3986 Section 2.3

So basically we need to also cover: ! * ' ( )