Search code examples
encodingurlencodeamazon-product-api

Amazon Signature Encoding


The Amazon documentation for "creating a signature" has some pretty specific requirements. In particular, it asks me to:

URL encode the parameter name and values according to the following rules:

  • Do not URL encode any of the unreserved characters that RFC 3986 defines. These unreserved characters are A-Z, a-z, 0-9, hyphen ( - ), underscore ( _ ), period ( . ), and tilde ( ~ ).
  • Percent encode all other characters with %XY, where X and Y are hex characters 0-9 and uppercase A-F.
  • Percent encode extended UTF-8 characters in the form %XY%ZA....
  • Percent encode the space character as %20 (and not +, as common encoding schemes do).

Does this encoding have a name?


Solution

  • I still don't know if the encoding has a name, but it is defined by RFC 3689. Once I knew that, finding a library was easy.