Draft
Fix UTF-8 encoding corruption in R scripts reading JSON from stdin#4509
Conversation
Agent-Logs-Url: https://github.com/stjude/proteinpaint/sessions/3837e9d4-0093-4d0e-b58c-36c20acef205 Co-authored-by: xzhou82 <1619109+xzhou82@users.noreply.github.com>
Agent-Logs-Url: https://github.com/stjude/proteinpaint/sessions/3837e9d4-0093-4d0e-b58c-36c20acef205 Co-authored-by: xzhou82 <1619109+xzhou82@users.noreply.github.com>
Agent-Logs-Url: https://github.com/stjude/proteinpaint/sessions/3837e9d4-0093-4d0e-b58c-36c20acef205 Co-authored-by: xzhou82 <1619109+xzhou82@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
xzhou82
May 13, 2026 20:43
View session
Collaborator
|
this fix doesn't work |
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
UTF-8 characters in series labels (e.g., '≥30.78') were corrupted to '��30.78' in R script outputs. R was defaulting to system encoding rather than UTF-8 when reading stdin.
Changes
Fixed four R scripts that read JSON data containing potentially non-ASCII labels:
R/src/survival.R- survival analysisR/src/cuminc.R- cumulative incidence analysisR/src/regression.R- regression analysisR/src/density.R- density calculationsEach changed from:
To:
The
readLines()call inherits encoding from the connection, so no additional parameter needed.Checklist
Check each task that has been performed or verified to be not applicable.