not ascii characters in Cookies #3240
Unanswered
kox-solid
asked this question in
Potential Issue
Replies: 1 comment 1 reply
-
You can try the following methods, which may solve your problem. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to pass a cookie with non-ascii characters to Client:
raise
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 13: ordinal not in range(128)
in Headers.setitem()Class Headers has a mechanism to switch to "iso-8859-1" encoding for situations like this, but it only works during a session. Class Request creates a new instance of Headers with "ascii" encoding by default, so there are no methods to set a different encoding other than Monkey Patching.
Maybe I'm wrong?
Beta Was this translation helpful? Give feedback.
All reactions