Skip to content

Conversation

@ericcj
Copy link
Owner

@ericcj ericcj commented Dec 11, 2025

it's unclear why the body has the wrong encoding maybe our client isn't correctly defaulting to utf-8 when Content-Type is missing or something, so a deeper fix is probably a good idea someday. But this at least prevents exceptions on printing exceptions which obscures underlying errors. E.g.. we got this on the fulfillment preview endpoint for invalid addresses that included utf-8 but then got errors like these back when trying to print that:

Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8 Encoding::UndefinedConversionError ("\xC3" from ASCII-8BIT to UTF-8)

it's unclear why the body has the wrong encoding maybe our client isn't correctly defaulting to utf-8 when Content-Type is missing or something, so a deeper fix is probably a good idea someday.  But this at least prevents exceptions on printing exceptions which obscures underlying errors.  E.g.. we got this on the fulfillment preview endpoint for invalid addresses that included utf-8 but then got errors like these back when trying to print that:

Encoding::CompatibilityError:  incompatible character encodings: ASCII-8BIT and UTF-8
Encoding::UndefinedConversionError ("\xC3" from ASCII-8BIT to UTF-8)
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.

2 participants