Add support for multi-byte chars like emojis (💡) in light device toggle buttons#24482
Open
aschober wants to merge 4 commits intoarendst:developmentfrom
Open
Add support for multi-byte chars like emojis (💡) in light device toggle buttons#24482aschober wants to merge 4 commits intoarendst:developmentfrom
aschober wants to merge 4 commits intoarendst:developmentfrom
Conversation
…bels for light device toggle buttons - Remove the 3-character buffer truncation of light device toggle button labels allowing multi-byte characters like emojis - Rely on CSS to handle truncation and add `max-width:0` to the td so it respects the provided percentage width instead of expanding to fit content - Wrap button content in a span with overflow handling to prevent layout breakage
s-hadinger
reviewed
Feb 22, 2026
- Add `Utf8Truncate` function in `support.ino` to truncate UTF-8 strings to a max chars limit or max visual width limit - Truncate light device button text to max 4 chars or max width of 4 before passing to button HTML template - cache calls to GetWebButton so only called once and update bool var from `set_button` to `has_web_button`.
…nd visual width handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Improve UTF-8 handling for light device toggle button labels (including emojis like 💡) by truncating safely before rendering.
D_BUTTON_TOGGLE.has_web_button) to avoid repeated lookups.Related issue (if applicable): fixes #
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass