Skip to content

Backport Chat Box UTF-8 support to 1.20.1#820

Merged
zyxkad merged 2 commits intoIntelligenceModding:dev/1.20.1from
Kondrashka177:dev/1.20.1
Apr 17, 2026
Merged

Backport Chat Box UTF-8 support to 1.20.1#820
zyxkad merged 2 commits intoIntelligenceModding:dev/1.20.1from
Kondrashka177:dev/1.20.1

Conversation

@Kondrashka177
Copy link
Copy Markdown

PLEASE READ THE GUIDELINES BEFORE MAKING A CONTRIBUTION

  • Please check if the PR fulfills these requirements
  • The commit message are well described
  • All changes have fully been tested
  • What kind of change does this PR introduce? (Bug fix, feature, ...)
    Backport / compatibility improvement for Chat Box UTF-8 support on 1.20.1.

  • What is the current behavior? (You can also link to an open issue here)
    On 1.20.1, Chat Box UTF-8 behavior is incomplete compared to the already documented API.
    Messages containing non-ASCII characters may be lost or degraded when sent from Lua, and incoming chat events do not expose a UTF-8-safe message payload for scripts.

  • What is the new behavior (if this is a feature change)?
    This PR backports the Chat Box UTF-8 behavior from 1.21.1 to 1.20.1.

It adds support for the optional trailing utf8Support argument to:

  • sendMessage
  • sendMessageToPlayer
  • sendToastToPlayer
  • sendFormattedMessage
  • sendFormattedMessageToPlayer
  • sendFormattedToastToPlayer

It also extends the emitted chat event with:

  • messageUtf8 as the 5th payload value

This keeps old scripts compatible while allowing new scripts to safely work with UTF-8 text.

  • Does this PR introduce a breaking change? (What changes might users need to make in their scripts due to this PR?)
    No.

This PR is intentionally backward compatible:

  • existing method names are unchanged
  • existing argument order is unchanged
  • utf8Support is optional and only added as the final argument
  • existing chat event fields are preserved

Old scripts should continue to work unchanged.
Scripts that want UTF-8-safe input can start reading the new messageUtf8 event value.

  • Other information:
    Tested on 1.20.1 with:
  • sendMessage
  • sendMessageToPlayer
  • sendToastToPlayer
  • sendFormattedMessage
  • sendFormattedMessageToPlayer
  • sendFormattedToastToPlayer

Observed behavior:

  • all tested methods returned success
  • UTF-8 output rendered correctly in chat and toasts
  • incoming chat events exposed readable UTF-8 text through messageUtf8
  • legacy message field remained unchanged for backward compatibility

This is a focused backport of Chat Box UTF-8 behavior only and does not attempt to backport unrelated 1.21.1 changes.

@github-actions
Copy link
Copy Markdown
Contributor

Build Preview

badge

You can find files attached to the below linked Workflow Run URL (Logs).

Name Link
Commit 45af0ad
Logs https://github.com/IntelligenceModding/AdvancedPeripherals/actions/runs/24539473409
Jar Files AdvancedPeripherals PR 820
Expires At 2026-07-15T23:32:29Z

@zyxkad zyxkad merged commit b1c7439 into IntelligenceModding:dev/1.20.1 Apr 17, 2026
4 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.

2 participants