Skip to content

Convert strings to UTF-8 #1624

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

c960657
Copy link

@c960657 c960657 commented May 14, 2025

Description

If the HTTP response body contains 8bit characters, and the adapter does not set the encoding of body to UTF-8 (like here: lostisland/faraday-net_http#13), the logger middleware fails with an error such as this:

log writing failed. "\xC3" from ASCII-8BIT to UTF-8

With this PR, the body is converted to UTF-8, replacing any 8-bit characters with the replacement character (U+FFFD, �).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant