You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some character codes (eg "\n") produce hex values which are less than "F" (eg "%A") which creates an error when decoded by the browser (it expects "%0A").
functionpad0(v){if(v.length>1)returnv;return'0'+v;}/** * encodes a character, if needed or not. * @param chr * @return pct-encoded character */functionencodeCharacter(chr){varresult='',octets=utf8.encode(chr),octet,index;for(index=0;index<octets.length;index+=1){octet=octets.charCodeAt(index);result+='%'+pad0(octet.toString(16).toUpperCase());}returnresult;}
The text was updated successfully, but these errors were encountered:
I have a 0.0.1 version and will check in, but the bug fixes have higher priority
Franz
Von: Paul Frazee [mailto:notifications@github.com]
Gesendet: Sonntag, 26. Mai 2013 17:40
An: fxa/uritemplate-js
Cc: Franz X Antesberger
Betreff: Re: [uritemplate-js] Percent encoding needs 0-padding if less than 2 digits (#12)
No problem! This has been a very useful library for me - I appreciate it.
Discovered on Chrome 26.0.1410.65, OSX 10.8.
Some character codes (eg "\n") produce hex values which are less than "F" (eg "%A") which creates an error when decoded by the browser (it expects "%0A").
To reproduce this issue:
A simple fix:
The text was updated successfully, but these errors were encountered: