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(scripting/mono-rt2): Fix UTF8 encoding issues for surrogate pairs and Korean characters #3267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

poco8537
Copy link
Contributor

Goal of this PR

Ensure that UTF8 encoding in the Mono v2 scripting environment correctly handles surrogate pairs and Korean characters, preventing string corruption during native interop.

How is this PR achieving the goal

This PR updates the UTF8 encoding functions to correctly handle surrogate pairs by encoding valid pairs as 4-byte sequences and replacing invalid or missing surrogates with the replacement character (U+FFFD), ensuring that Korean and other Unicode characters are encoded properly.

This PR applies to the following area(s)

ScRT: C#

Successfully tested on

Game builds: ..

Platforms: Windows, Linux

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixs #3263

@github-actions github-actions bot added ScRT: C# Issues/PRs related to either C# scripting runtimes triage Needs a preliminary assessment to determine the urgency and required action labels Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ScRT: C# Issues/PRs related to either C# scripting runtimes triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant