Bug 17332 - Parsing source in non-native encoding, problems with character encoded as 0xFF
Summary: Parsing source in non-native encoding, problems with character encoded as 0xFF
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific (show other bugs)
Version: R 3.4.1
Hardware: Other Other
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-08-28 14:15 UTC by Patrick Perry
Modified: 2017-08-28 14:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Perry 2017-08-28 14:15:57 UTC
Another instance of the bug reported on R-devel: https://stat.ethz.ch/pipermail/r-devel/2017-August/074832.html



On a Windows-1252 machine:

> Sys.setlocale("LC_CTYPE", "")
[1] "English_United States.1252"

> tmp <- tempfile()
> writeLines(iconv('"\u00ff"', "UTF-8", ""), tmp)

> source(tmp, encoding = "Windows-1252")
Error in source(tmp, encoding = "Windows-1252") :
 C:\Users\PATRIC~1\AppData\Local\Temp\Rtmpe2quTP\file11e83c5a5491:1:1: unexpected INCOMPLETE_STRING
1: "
    ^


This seems to only be a problem when the user specifies 'encoding' as part of the 'source' command.