-
Notifications
You must be signed in to change notification settings - Fork 4k
fix(data_connect)!: Correct UTF-8 decoding for international characters #17296
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
base: main
Are you sure you want to change the base?
Conversation
Previously, text containing characters from languages such as Korean, which are encoded in UTF-8, was not being decoded correctly. This resulted in characters appearing garbled or "broken". This commit updates the decoding logic to properly handle UTF-8 encoding, ensuring correct display and processing of international text.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hey there thanks for the PR! Can you please add some tests for this PR? |
Adds a new test case to verify that the RestTransport correctly decodes HTTP response bodies containing UTF-8 characters. This test specifically checks the handling of non-ASCII characters after the change to use `utf8.decode(r.bodyBytes)`.
@MichaelVerdon Thanks for the review! I've added test cases to cover the UTF-8 decoding change. |
Thank you this looks good! Can I get you to change 'final' to 'const' to shut the CI up. Happy to do this myself if need be. Then I am happy to approve this. 🥳
|
Fixes prefer_const_declarations lint warning.
@MichaelVerdon Done, I've changed 'final' to 'const' to fix the lint warning. Thanks for the suggestion! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Description
Previously, text containing characters from languages such as Korean, which are encoded in UTF-8, was not being decoded correctly. This resulted in characters appearing garbled or "broken".
This commit updates the decoding logic to properly handle UTF-8 encoding, ensuring correct display and processing of international text.
Related Issues
[firebase_data_connect] Response data Correct UTF-8 decoding for international characters Fixes #17290
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?