flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

fix(data_connect)!: Correct UTF-8 decoding for international characters

Open ska2519 opened this issue 7 months ago • 5 comments

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.

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • [ ] All existing and new tests are passing.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] The analyzer (melos run analyze) does not report any problems on my PR.
  • [x] I read and followed the Flutter Style Guide.
  • [x] I signed the CLA.
  • [x] I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • [x] Yes, this is a breaking change.
  • [ ] No, this is not a breaking change.

ska2519 avatar Apr 22 '25 00:04 ska2519

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.

google-cla[bot] avatar Apr 22 '25 00:04 google-cla[bot]

Hey there thanks for the PR! Can you please add some tests for this PR?

MichaelVerdon avatar Apr 30 '25 12:04 MichaelVerdon

@MichaelVerdon Thanks for the review! I've added test cases to cover the UTF-8 decoding change.

ska2519 avatar May 01 '25 09:05 ska2519

@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. 🥳

firebase_data_connect:
Analyzing ....

   info - test/src/network/rest_transport_test.dart:118:7 - Use 'const' for final variables initialized to a constant value. Try replacing 'final' with 'const'. - prefer_const_declarations

1 issue found.

MichaelVerdon avatar May 01 '25 10:05 MichaelVerdon

@MichaelVerdon Done, I've changed 'final' to 'const' to fix the lint warning. Thanks for the suggestion!

ska2519 avatar May 01 '25 11:05 ska2519

After the update on the server, i confirmed that the languages are being transferred normally from the server. I am closing this issue.

ska2519 avatar Jul 31 '25 03:07 ska2519