Visitar URL original
cookie header is not supporting utf-8 encoding · Issue #105505 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20250523084335/https://github.com/python/cpython/issues/105505
Skip to content

cookie header is not supporting utf-8 encoding #105505

Open
@MathieuB1

Description

@MathieuB1

Bug report

Hi everyone,

When passing headers that contain utf-8 characters (in my case a Cookie), it failed to encode the correct charset because stuck on latin-1 encoding.

File "/usr/lib/python3.9/http/client.py at line 1228
values[i] = one_value.encode('latin-1')

Can you please fix this one and set the default encoding as utf-8? I don't see why the 'latin1' charset have been set. It should be related to this change 8f36af7

Many thanks in advance

Your environment

python3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions