Skip to content

fix windows test for R 4.2.0 - #1090

Merged
MichaelChirico merged 2 commits into
masterfrom
fix/ucrt
Apr 25, 2022
Merged

MichaelChirico merged 2 commits into
masterfrom
fix/ucrt

Conversation

@AshesITR

Copy link
Copy Markdown
Collaborator

No description provided.

msg <- "Invalid multibyte character in parser. Is the encoding correct?"
if (.Platform$OS.type == "windows") {
# Windows parser throws a different error message because the source code is converted to native encoding
if (.Platform$OS.type == "windows" && getRversion() < "4.2.0") {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe we can just use l10n_info()? would rather test for capabilities than system properties

also worth giving a quick check on the rest of the codebase for similar tests...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

How would this test go with l10n_info() I don't have 4.2.0 on windows at the moment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is if (!l10n_info()[["UTF-8"]]) { ... } correct? I just installed R 4.2.0 to see what windows UCRT reports:

> l10n_info()
$MBCS
[1] TRUE

$`UTF-8`
[1] TRUE

$`Latin-1`
[1] FALSE

$codepage
[1] 65001

$system.codepage
[1] 65001

4.1.2 reports

> l10n_info()
$MBCS
[1] FALSE

$`UTF-8`
[1] FALSE

$`Latin-1`
[1] TRUE

$codepage
[1] 1252

$system.codepage
[1] 1252

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

that looks right to me

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

better to use isTRUE() as I'm not 100% sure that element is always there?

@MichaelChirico
MichaelChirico merged commit ef2bf44 into master Apr 25, 2022
@MichaelChirico
MichaelChirico deleted the fix/ucrt branch April 25, 2022 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants