Draft: Add practical UTF-8 support across terminal input/output paths#2416
Closed
Kondrashka177 wants to merge 5 commits intocc-tweaked:mc-1.20.xfrom
Closed
Draft: Add practical UTF-8 support across terminal input/output paths#2416Kondrashka177 wants to merge 5 commits intocc-tweaked:mc-1.20.xfrom
Kondrashka177 wants to merge 5 commits intocc-tweaked:mc-1.20.xfrom
Conversation
4e7d56a to
6c808cb
Compare
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.
Summary
This PR is an attempt to improve practical UTF-8 support in CC: Tweaked's terminal-related paths.
The goal here is not to claim that full Unicode support is solved, but to provide a working implementation for the most common user-facing cases inside CC itself: terminal output, terminal input, text editing, monitor rendering, and related ROM paths.
I am opening this as a draft because I do not consider the design questions around backwards compatibility fully resolved, and I want to present the implementation and tested behaviour clearly rather than oversell it as a finished universal solution.
What this changes
This branch updates multiple terminal and ROM text paths so that UTF-8 text can be handled correctly in common scenarios.
In practice, this includes work around:
term.writeterm.blitread()edit.luacc.prettycc.stringspastebin put/getTested behaviour
The following scenarios have been tested and are working in this branch:
read()term.writeterm.blitwindow.writewindow.bliteditInvalid UTF-8 textin the tested casespastebin put/getwith UTF-8 contentImportant limitations
This branch does not claim to solve all Unicode issues.
Known limitations include:
In other words, this branch is best described as a practical UTF-8 implementation for common CC text workflows, not a complete and compatibility-perfect Unicode redesign.
Backwards compatibility
I understand the main concern here is not just "can UTF-8 be made to work", but whether it can be introduced without breaking long-standing byte-oriented assumptions in CC programs and internal behaviour.
I do not want to pretend this draft fully solves that design problem.
This PR is therefore intended as:
If this direction is considered fundamentally incompatible with the project's compatibility goals, that is understandable. In that case, this branch may still be useful as a reference implementation or experiment.
Why submit this anyway
Even with the compatibility concerns, I think there is still value in showing the implementation and the practical results.
The issue affects real users in day-to-day use, especially in non-English environments, and this branch demonstrates that a substantial part of the user-facing experience can be improved inside CC itself.
Notes
I am very open to feedback on scope, structure, or whether this is better treated as an experiment/prototype rather than a mergeable change in its current form.