Skip to content

use UTF-8 strings in a few more places - #8433

Merged
jmcphers merged 2 commits into
masterfrom
bugfix/rfunction-utf8-params
Nov 18, 2020
Merged

jmcphers merged 2 commits into
masterfrom
bugfix/rfunction-utf8-params

Conversation

@kevinushey

@kevinushey kevinushey commented Nov 18, 2020 •

Copy link
Copy Markdown
Collaborator

Intent

While testing on a Windows account with a user with non-English letters, I noticed a couple more issues with handling of filenames:

Error in file.exists(index) : 
  file name conversion problem -- name too long?
Error in file.exists(index) : 
  file name conversion problem -- name too long?
Error in file.exists(index) : 
  file name conversion problem -- name too long?
Warning message:
In list.files(cacheDir) :
  unable to translate 'C:/Users/Cr<e8>me Br<fb>l<e9>e/Desktop/renv/.Rproj.user/24A05536/explorer-cache' to native encoding

From what I understand, this is caused by (failed?) attempts to convert UTF-8 strings to the native encoding, as opposed to just using the UTF-8 strings as-is.

Approach

Augment our RFunction class with a new addUtf8Param() function, which is used to add strings (or string-like things) which should be UTF-8 encoded.

QA Notes

Testing this is somewhat broad: it would be worth checking that RStudio functions without issue on Windows, for a user whose user name has accented characters. (I tested with an account name Crème Brûlée.

Closes #8435.

@jmcphers jmcphers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but: does this fix an existing (tracked) issue? Do we need it for 1.4?

@kevinushey

Copy link
Copy Markdown
Collaborator Author

I filed an associated issue here:

#8435

If I understand correctly, this issue will effect anyone on Windows who is using R 4.0+, and has non-ASCII characters in their username. Given the potential prevalence of the issue I think it's worth fixing for 1.4.

@jmcphers
jmcphers merged commit 51c6fb4 into master Nov 18, 2020
@valerie-rstudio
valerie-rstudio deleted the bugfix/rfunction-utf8-params branch January 21, 2022 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warnings on session launch when username contains non-ASCII chars

2 participants