-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 \r\n-style line endings not being properly handled for script errors #20871
Conversation
This doesn't feel correct. The vast majority of the codebase doesn't have or use \r so removing it here doesn't make sense. It should be removed the moment a string enters our codebase. |
The flawed implementation is this function assuming that all strings use just |
it's a correct assumption though. Why would text contain \r ? We go to great lengths to not have any \r in the engine |
This is in line with
where a similar correction is done in UI code. |
If we are going to handle \r, it should either be engine wide or at the source. Not somewhere in the middle like this PR IMO it should be moved to |
Ideally it would be moved to somewhere that handles all text that we display in-game. |
we remove the \r when streaming files & reading yaml. So basically in most places you can't find \r and it doesn't make sense to handle at a UI level |
On the other hand, it is not And yes, the most prominent source of "\r\n" would likely be .NET exceptions, but it could also be any library that we use, any text that is somehow read by the game to be displayed and perhaps even user text pasted into the chat? |
Then we should also add \r removal in chat input |
I would lean towards PunkPun opinion. Best to strip at input, before start, or support it throughput. |
Seems like I got outvoted (here and on Discord), so changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Untested
Otherwise the
\r
characters remain on their own (without\n
characters) and display as artifacts.