You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uploading a zip in the Files pane extracts to the wrong folder on Windows with R < 4.2 when the path has non-ASCII characters #19627
Other RFunction callers pass getAbsolutePath() through addParam() too. A general fix is an RFunction::addParam overload for FilePath that always marks UTF-8 (r::sexp::createUtf8(const FilePath&) already exists), so callers can't pick the wrong encoding.
Describe the behavior you expected
The zip is expanded into the folder it was uploaded to.
The Files pane isn't the only place this happens. These RFunction::addParam() calls also pass FilePath::getAbsolutePath() (UTF-8) to R marked as native encoding, so with R < 4.2 on Windows a non-ASCII path names a different file in R:
src/cpp/session/modules/SessionFiles.cpp:928, :929 (zip upload, described above)
Other callers already handle this, either with addUtf8Param() or by converting with string_utils::utf8ToSystem() first. Rather than fixing each site, an addParam overload for FilePath that always marks UTF-8 (using the existing r::sexp::createUtf8(const FilePath&)) would stop new call sites from repeating the mistake. Like #19625, characters outside the system code page still won't work with R < 4.2.
Found in review of #19628, which fixes the Posit Assistant install paths only. None of these sites has been reproduced individually.
Activity
gtritchie commentedon Nov 13, 2026
The Files pane isn't the only place this happens. These
RFunction::addParam()calls also passFilePath::getAbsolutePath()(UTF-8) to R marked as native encoding, so with R < 4.2 on Windows a non-ASCII path names a different file in R:src/cpp/session/modules/SessionFiles.cpp:928,:929(zip upload, described above)src/cpp/r/session/graphics/RGraphicsPlotManager.cpp:362,:371,:381src/cpp/r/session/graphics/RGraphicsPlotManipulator.cpp:62,:70src/cpp/session/modules/SessionDiagnostics.cpp:1008src/cpp/session/modules/SessionRenv.cpp:144src/cpp/session/modules/SessionTutorial.cpp:107,:401,:411Other callers already handle this, either with
addUtf8Param()or by converting withstring_utils::utf8ToSystem()first. Rather than fixing each site, anaddParamoverload forFilePaththat always marks UTF-8 (using the existingr::sexp::createUtf8(const FilePath&)) would stop new call sites from repeating the mistake. Like #19625, characters outside the system code page still won't work with R < 4.2.Found in review of #19628, which fixes the Posit Assistant install paths only. None of these sites has been reproduced individually.
pass search-path env data and keybindings paths as FilePath
test lazy modules on a non-ascii path in the c locale
mark strings exchanged with r as utf-8 by default
drop conversions that made up for native r strings
look up names read from r by their native symbol
read saved search path files as utf-8
convert async r process output to utf-8
mark file paths passed to R as utf-8 (#19640)