Shopify/turbograft — pull request #45 by kurtfunai (2014-12-05 07:11:00+00:00)
Title: Changed uriEncodeForm method to use encodeURIComponent instead of encode...

...URI to properly escape + characters. Fixes #44

More info:
Ran into issues with my authenticity_token being passed incorrectly to my server. The + sign was not being encoded properly before being sent, and was being received as a space character by my server.

encodeURI replaces all characters except the following with the appropriate UTF-8 escape sequences:
```
Type	Includes
Reserved characters	; , / ? : @ & = + $
nescaped characters	alphabetic, decimal digits, - _ . ! ~ * ' ( )
Score	#
```
> Note that encodeURI by itself cannot form proper HTTP GET and POST requests, such as for XMLHTTPRequests, because "&", "+", and "=" are not encoded, which are treated as special characters in GET and POST requests. encodeURIComponent, however, does encode these characters.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI

Changed it to use the [encodeURIComponent](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) instead.