Skip to content

Conversation

@limbonaut
Copy link
Collaborator

@limbonaut limbonaut commented Sep 3, 2025

This PR fixes issues with retaining UTF-8 encoding in native SentryEvent implementation, discovered while working on tests in #326. The problem is that getters should be using String::utf8() where we reasonably expect UTF-8. Extracted from #326.

@limbonaut limbonaut added Bug Something isn't working Testing labels Sep 3, 2025
@limbonaut limbonaut changed the title fix: UTF-8 retention problems in native SentryEvent implementation fix: UTF-8 retention problems with native SentryEvent properties Sep 3, 2025
@limbonaut limbonaut marked this pull request as ready for review September 3, 2025 10:48
assert_str(event.get(property)).is_equal("Hello, World!")
event.set(property, "Hello 世界! 👋")
assert_str(event.get(property)).is_equal("Hello 世界! 👋")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This replaces multiple tests removed below.

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

Are there any recursive dict/array conversions or such where the same problem could occur?

@limbonaut
Copy link
Collaborator Author

@jpnurmi Yes, we convert Godot types to internal SDK types recursively, but not the other way around (at least not yet). We’ll be testing it in one of the future PRs. Here’s a work-in-progress glimpse: c5969ba

@limbonaut limbonaut merged commit dbd3647 into main Sep 3, 2025
49 checks passed
@limbonaut limbonaut deleted the fix/event-utf8 branch September 3, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UTF-8 not preserved in some API calls on Linux and Windows

3 participants