File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,17 @@ function(cfile, encoding = NULL)
3131 # #
3232 # # FIXME: if parse() could be told to read strings bytewise,
3333 # # we could simply convert to UTF-8.
34- if (encoding %in% c(" latin1" , " UTF-8" ) && ! l10n_info()$ MBCS ) {
34+ if (((encoding == " UTF-8" ) && l10n_info()$ `UTF-8` ) ||
35+ ((encoding %in% c(" latin1" , " UTF-8" )) && ! l10n_info()$ MBCS )) {
3536 # # NOTE: in an MBCS locale, calling parse() with a "UTF-8" or
3637 # # "latin1" encoding argument in order to get character strings
3738 # # marked as UTF-8 or latin1 does not work, as such encoding
3839 # # arguments are ignored with a warning. So one needs to use a
3940 # # file connection to re-encode as below, and cannot get strings
4041 # # marked. One might consider this a bug and not a feature ...
42+ # # (Actually, since c79007 parse(encoding = "UTF-8") is ignored
43+ # # with a warning only when running in a non-UTF-8 MBCS locale,
44+ # # see above.)
4145 parse(file = cfile , encoding = encoding )
4246 } else if (encoding %in% c(" C" , " ASCII" )) {
4347 # # We do want to make sure this is ASCII: in single-byte
You can’t perform that action at this time.
0 commit comments