-
Notifications
You must be signed in to change notification settings - Fork 476
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
encoding issue with gb2312 data #87
Comments
I can reproduce the issue in Firefox 21 on Mac. This sequence is the problem
Can you check what character's this sequence should resolve to? Can you make sure that the data is UTF-8? |
As far as I can tell, given the Now, how to deal with this is tricky because the original url has come into our website via Google Hong Kong so we have no way of controlling how the data is encoded. Do I change URI.js to use unescape? At the moment, I run every url through unescape() anyway so that URI.js doesn't crash on the weird ones. |
well, URI.js supports UTF8 and ISO 8859 mode. You could easily wrap things: URI.prototype.getQueryParameters = function() {
var uri = URI(this.search());
try {
return uri.search(true);
} catch(e) {
return uri.unicode().search(true);
}
}; yielding: I'm not sure if I'd want this to happen automatically, internally, without the implementor even noticing… |
See #92 as well |
This issue's popped up again and I'm trying to figure out how to get around it. var uri = new URI(url);
//...
var uQuery = uri.clone().setQuery(""); It's the setQuery that's failing. How do I set my query to nothing without using setQuery()? |
Ok, simple answer: |
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. |
Context: Microsoft JScript on Windows Server 2008 R2 64bit
When the .search is executed I get
The break occurs here
and it's probably complaining about the
"sa=%20%CB%D1%20%CB%F7%20"
. What's amiss here? Is it fixable? Is it an encoding issue or something else?The text was updated successfully, but these errors were encountered: