From davorj at live.com  Thu Feb 15 08:36:30 2018
From: davorj at live.com (Davor Josipovic)
Date: Thu, 15 Feb 2018 07:36:30 +0000
Subject: [Rd] writeLines argument useBytes = TRUE still making conversions
Message-ID: <MWHPR03MB327997228A6D35430EA431FBA7F40@MWHPR03MB3279.namprd03.prod.outlook.com>

I think this behavior is inconsistent with the documentation:

  tmp <- '?'
  tmp <- iconv(tmp, to = 'UTF-8')
  print(Encoding(tmp))
  print(charToRaw(tmp))
  tmpfilepath <- tempfile()
  writeLines(tmp, con = file(tmpfilepath, encoding = 'UTF-8'), useBytes = TRUE)

[1] "UTF-8"
[1] c3 a9

Raw text as hex: c3 83 c2 a9

If I switch to useBytes = FALSE, then the variable is written correctly as  c3 a9.

Any thoughts? This behavior is related to this issue: https://github.com/yihui/knitr/issues/1509


	[[alternative HTML version deleted]]



[Rd] writeLines argument useBytes = TRUE still making conversions
Davor Josipovic