Skip to content
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

Non-ascii arguments in the native encoding are garbled on Windows #263

Closed
gaborcsardi opened this issue Aug 6, 2020 · 1 comment
Closed
Labels
bug an unexpected problem or unintended behavior

Comments

@gaborcsardi
Copy link
Member

gaborcsardi commented Aug 6, 2020

Because processx assumes that they are in UTF-8. R 4.0.2, Windows 10:

ASCII app:

local_temp_dir()
name <- enc2native("\u00fa\u00e1\u00f6")

out <- run(get_tool("px"), c("writefile", "of", name))
expect_equal(
    charToRaw(name),
    readBin("of", what = "raw", n = 100)
)
#> Error: charToRaw(name) not equal to readBin("of", what = "raw", n = 100).
#> 3 element mismatches

Unicode app:

out2 <- run(get_tool("pxu"), c("writefile", "of2", name))
expect_equal(
    iconv(name, to = "UCS-2LE", toRaw = TRUE)[[1]],
    readBin("of2", what = "raw", n = 100)
)
#> Error: iconv(name, to = "UCS-2LE", toRaw = TRUE)[[1]] not equal to readBin("of2", what = "raw", n = 100).
#> 6 element mismatches
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Aug 6, 2020
@gaborcsardi
Copy link
Member Author

Closed by #265.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant