From kevinu@hey @ending from gm@il@com  Mon Jul 16 22:01:50 2018
From: kevinu@hey @ending from gm@il@com (Kevin Ushey)
Date: Mon, 16 Jul 2018 13:01:50 -0700
Subject: [Rd] Output mis-encoded on Windows w/ RGui 3.5.1 in strange case
Message-ID: <CAJXgQP2vJPAJav3F_g=LT+-a4ogV+e-7c97DGu6uy-e4_VWL3g@mail.gmail.com>

Given the following R script:

   x <- 1
   print(list())
   save(x, file = tempfile())
   output <- encodeString("apple")
   print(output)

If I source this script from RGui on Windows, I see the output:

   > source("encoding.R")
   list()
   [1] "\002??apple\003??"

That is, it's as though R has injected what looks like byte order
marks around the encoded string:

   > charToRaw(output)
    [1] 02 ff fe 61 70 70 6c 65 03 ff fe

FWIW I see the same output in R-patched and R-devel. Any idea what
might be going on? For what it's worth, I don't see the same issue
with R as run from the terminal.

Thanks,
Kevin



[Rd] Output mis-encoded on Windows w/ RGui 3.5.1 in strange case
Kevin Ushey