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

Fix UTF8 strings inside structs #347

Merged
merged 2 commits into from
Aug 2, 2020
Merged

Fix UTF8 strings inside structs #347

merged 2 commits into from
Aug 2, 2020

Conversation

rlabrecque
Copy link
Owner

@rlabrecque rlabrecque commented Apr 12, 2020

When marshaling structs containing UTF8 strings we need to explicitly marshal them ourselves.

Idea taken from:
@Akarinnnnn
#339

@rlabrecque
Copy link
Owner Author

Feedback appreciated!

We can't use Span unfortunately because Unity doesn't support it yet.

We can't use an ICustomMarshaler because Unity has had pretty bad issues with them in the past (crashing when a string is between 96 and 127 characters long for example.)

@Akarinnnnn
Copy link
Contributor

Seems good to merge. Consider to merge?

@rlabrecque
Copy link
Owner Author

It's in! I regenerated against 1.49 and swapped to get {} set {}, instead of get => set => for compatibility with Unity 4.7 (hopefully no one's using that still?)

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.

None yet

2 participants