Open
Conversation
Not all ANSI encodings can represent accented Latin characters. For non-representable strings, enc2native() may substitute a different character (observed: "o" instead of "o with an umlaut), which fails a later comparison of the file name with the original, non-converted string.
Test 1164.1 should pass with UTF-8 encoded strings without converting them to the native encoding.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7681 +/- ##
=======================================
Coverage 99.04% 99.04%
=======================================
Files 87 87
Lines 17031 17031
=======================================
Hits 16868 16868
Misses 163 163 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests
1966.*failed on my Windows 7 VM where I testdata.tablewith old versions of R.öcannot be represented in CP1251, andenc2native()converted it to a plain unaccentedo. If the characters cannot be represented in the ANSI encoding, we might as well skip the tests. (What if it returnsNAor?on a different system?)Test
1164.1shouldn't require the characters to be represented in the native encoding, because it only uses UTF-8 and Latin-1. Bothmatch()andchmatch()offer a strong enough guarantee. Tested on the same Windows 7 VM, and also usingLC_ALL=zh_CN.gb2312 luit R CMD check(GB2312 doesn't haveäorß) andLC_ALL=Con GNU/Linux.