[Rd] Rprintf expected encoding
pperry at stern.nyu.edu
Fri Jun 30 22:24:05 CEST 2017
I'm trying to find information about how to use Rprintf with a UTF-8
encoded string, and I'm not sure what the right cross-platform usage is.
I found an earlier thread about this
but it wasn't very helpful.
If I want to print a UTF-8 string, I can do one of the following:
1) Send native data via Rprintf("%s", translateChar(str));
2) Send UTF-8 data via Rprintf("%s", translateCharUTF8(str));
If Rprintf is sending its output to stdout, then (1) seems like the
correct option. If Rprintf is sending to a file connection with encoding
set to UTF-8 (for example, after a call to sink(file(...,
encoding="UTF-8"))), then (2) is correct. Is there any way to know the
encoding that Rprintf is expecting?
New York University
More information about the R-devel