randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

Problems with UTF-8 on Windows #482

Open huguesmp opened 1 week ago

huguesmp commented 1 week ago

Versions 0.6.7 and 0.6.8+ introduced problems for me on Windows. Since it is on my work machine, I cannot post screenshots unfortunately.

When I run for example devtools::check() on 0.6.7, I get many lines like this:

Warning in Sys.setlocale("LC_CTYPE", ctype) :
  using locale code page other than 1252 may cause problems

But the operation succeeds.

With radian 0.6.8 and above (I tested every version up to 0.6.12), I get many lines like these (the number is not always 2, it varies):

Warning in grep("^[^\\s]+:$", lines, perl = TRUE, value = TRUE) :
  input string 2 is invalid UTF-8

Then the devtools::check() command fails. It looks like it is unable to parse some files in my package, even though they are all in UTF-8. Other commands like use_version() also fail.

I see from the changelog that some changes to UTF-8 handling were made in these two versions.

image

My machine is Windows 10 pro and the LC_CTYPE=French_Canada.1252

huguesmp commented 1 week ago

I should add that downgrading to 0.6.6 fixes this problem.