Bug 16539 - capture.output forgets character encodings
Summary: capture.output forgets character encodings
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: I/O (show other bugs)
Version: R-devel (trunk)
Hardware: All All
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-09-21 10:16 UTC by Richard Cotton
Modified: 2015-09-21 10:16 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 Richard Cotton 2015-09-21 10:16:22 UTC
Given a character string with an encoding

x <- "\u20ac"
print(x)
## [1] "€"
Encoding(x)
## [1] "UTF-8"

capturing the output loses that encoding.

capture.output(print(x))
## [1] "[1] \"¢æ\""

It would be easier to capture non-ASCII text if capture.output preserved the encoding.