New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded % symbol crashes #92

Closed
axtens opened this Issue May 27, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@axtens

axtens commented May 27, 2013

Context: Microsoft JScript on Windows Server 2008 R2 64bit

var url = "http://www.google.com/url?sa=t&rct=j&q=% FREE Call Forwarding&source=web&cd=27&cad=rja&ved=0CG8QFjAGOBQ";
var x = new URI(url);
var rMap = x.search(true);

When the .search is executed I get

Microsoft JScript runtime error: The URI to be decoded is not a valid encoding

The break occurs here

d.decodeQuery = function (a) {
    return d.decode((a + "").replace(/+/g, "%20"))
};

It's probably complaining about the "q=% FREE Call Forwarding". The percent symbol in this case is not introducing an encoded value. In my own code I'll check for a % after unescaping and change it to something (not sure what yet). However, what can be done for URI.js?

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Aug 3, 2013

Member

I've fixed this in master - it will be included in the next release. thank you for your help!

QueryString data that cannot be decoded will now simply be returned undecoded - that way any decodable data can still be of use.

Member

rodneyrehm commented Aug 3, 2013

I've fixed this in master - it will be included in the next release. thank you for your help!

QueryString data that cannot be decoded will now simply be returned undecoded - that way any decodable data can still be of use.

@rodneyrehm rodneyrehm closed this Aug 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment