Bug 17332

Summary: Parsing source in non-native encoding, problems with character encoded as 0xFF
Product: R Reporter: Patrick Perry <pperry>
Component: Windows GUI / Window specificAssignee: R-core <R-core>
Status: CLOSED FIXED    
Severity: minor CC: tomas.kalibera
Priority: P5    
Version: R 3.4.1   
Hardware: Other   
OS: Other   

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.
Comment 1 Tomas Kalibera 2018-04-09 11:14:35 UTC
Thanks, fixed in 74554 and ported to R-3.5.0.