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

Problem: Strings in the CBOR to JSON conversion code were being appended incorrectly #14

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

hamchapman
Copy link
Contributor

Strings in the CBOR to JSON conversion code were being appended to the out string using appendFormat with the %s format specifier. This does not guarantee that UTF8 will be used as the encoding and it will in fact use whatever encoding is the default on the device that is running the code. On macOS, for most users, this will in fact be macOS Roman, which leads to things like £ characters (anything that's over one byte in UTF8, really) being appended to the out string incorrectly, because they're appended using the wrong encoding.

Solution: Explicitly use UTF8 encoding in the CBOR to JSON conversion code.

…ded to the

`out` string using `appendFormat` with the `%s` format specifier. This does not
guarantee that UTF8 will be used as the encoding and it will in fact use
whatever encoding is the default on the device that is running the code. On
macOS, for most users, this will in fact be macOS Roman, which leads to things
like `£` characters (anything that's over one byte in UTF8, really) being
appended to the `out` string incorrectly, because they're appended using the
wrong encoding.

Solution: Explicitly use UTF8 encoding in the CBOR to JSON conversion code.
Copy link
Contributor

@podkovyrin podkovyrin left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! 0.4.4 on their way.

@podkovyrin podkovyrin merged commit 8e06311 into dashevo:master Feb 19, 2020
@connorpower connorpower deleted the hc/utf8-string-fixes branch April 21, 2020 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants