Skip to content

cookie header is not supporting utf-8 encoding #105505

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

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions