-
Notifications
You must be signed in to change notification settings - Fork 140
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
Can't make request with non-ascii/utf8 query params #303
Comments
Sorry for the slow response here. I didn't realize that arbitrary It looks like there is a similar issue if an oddly-encoded querystring is passed as part of the url parameter. You'll get a treq.get('http://requestbin.net/r/1l2gc1o1?foo=%FF%FE%00%00H%00%00%00e%00%00%00l%00%00%00l%00%00%00o%00%00%00') It looks like we can avoid this by passing Unfortunately, #265 (comment) isn't the solution either. Decoding UTF-32 I see two options:
Could you provide a little color on what you're trying to do to help with this? |
Per discussion on #303, bytes should pass through even if they aren't UTF-8 encoded.
I work with a wide variety of third-party messaging APIs, many of which are poorly designed and require all the message fields to be in url query parameters. This is fine when we're sending English-language text with no special characters (which fits into 7-bit ASCII), but can be a problem for languages like Swahili (often written in Arabic script) or Amharic when the API we're talking to expects UTF-16 or some weirdly-packed GSM encoding. |
Starting from 20.4.1, I can no longer make requests with weirdly-encoded query parameters.
Here's a small example program that makes such a request:
When run with treq 20.3.0:
And with treq 20.4.1:
#265 (comment) seems like relevant context here.
The text was updated successfully, but these errors were encountered: