Repository navigation
Fix transformation of non-ASCII on Windows - #18
Conversation
|
@krlmlr Didn't you forget to change AppVeyor's setting when renamed to enc? |
a119b03 to
dccbbee
Compare
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
======================================
Coverage 99.4% 99.4%
======================================
Files 8 8
Lines 167 167
======================================
Hits 166 166
Misses 1 1
Continue to review full report at Codecov.
|
|
I've confirmed the test fails with the current implementation and changing |
krlmlr
left a comment
There was a problem hiding this comment.
Thanks, I agree that enc should convert to UTF-8 as necessary.
|
|
||
| test_that("forward-reverse transformation works for latin1", { | ||
| # c.f. rlang::mut_latin1_locale() | ||
| locale <- if (.Platform$OS.type == "windows") "English_United States.1252" else "en_US.ISO8859-1" |
There was a problem hiding this comment.
I'd rather test this only on Windows, because locale names are inconsistent on other OS.
|
My AppVeyor settings are a mess right now, need to review eventually. |
|
Thanks! |
- Fix transformation of non-ASCII text on Windows (#18, @yutannihilation).
I believe this fixes r-lib/styler#329.
As described the original issue above, in
transform_lines_enc_one(), there is nothing to ensurenew_textis in the UTF-8 encoding whilewrite_lines_enc()requires UTF-8.enc/R/io.R
Lines 109 to 116 in 883df89
I don't see any major drawbacks to change
as.character()toto_utf8(), but I'm still not sure whyas.character()was introduced here. Shouldn't it throw an error whenfun()returns non-characters? What cases does it consider about?