Skip to content
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

improve UTF-8 string handling in JSONValue #6011

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

ChangYanChu
Copy link
Contributor

feat(JSONValue): improve UTF-8 string handling in JSONValue

  • Add proper UTF-8 multi-byte character sequence handling
  • Add boundary checks for UTF-8 sequences
  • Keep original code structure and flow
  • Add detailed comments for UTF-8 processing logic

This change here to resolve the issue where UTF-8 characters within the "JSON output" feature of the MQTT module were being converted to \u0000, while maintaining the original code structure and processing flow. Thank you :)

```text
feat(json): improve UTF-8 string handling in JSONValue

- Add proper UTF-8 multi-byte character sequence handling
- Add boundary checks for UTF-8 sequences
- Keep original code structure and flow
- Add detailed comments for UTF-8 processing logic

This change improves the robustness of JSON string handling
while maintaining compatibility with existing code.
@CLAassistant
Copy link

CLAassistant commented Feb 8, 2025

CLA assistant check
All committers have signed the CLA.

@hayschan
Copy link

hayschan commented Feb 8, 2025

Finally, someone stood out to fix #3562 and possibly #2601 as well.

Can't wait to see this fix for supporting all the non-ASCII JSON messages:

  • CJK: Chinese, Japanese, Korean
  • all the other non ASCII languages
  • emojis

Copy link
Contributor

@fifieldt fifieldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks good. Thanks so much for contributing!

@fifieldt fifieldt merged commit d70a939 into meshtastic:master Feb 8, 2025
50 checks passed
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.

4 participants