Skip to content

Using unicode with sprintf or paste in Windows (PR#11515)

1 message · mwtoews at sfu.ca

#
Full_Name: Michael Toews
Version: 2.7.0
OS: Windows XP SP2
Submission from: (NULL) (24.80.163.230)


Using Unicode characters in Windows works with static strings (as of R 2.7.0),
however fails when used with sprintf() or paste(). For example, on R 2.7.0 for
Windows XP (SP2):

Static string (works, showing Greek Delta character):
[1] "ΔQ = 2.2 L/s"

However, when I use paste() or sprintf(), the Unicodeness is lost:
[1] "<U+0394>Q = 1.234 L/s"
[1] "<U+0394>Q = 1.234 L/s"


I have also tested this with R 2.7.0 for Linux, which yields the following:
[1] "&#916;Q = 2.2 L/s"
[1] "&#916;Q = 1.234 L/s"
[1] "&#916;Q = 1.234 L/s"

(Note: this was posted on R-help with no replies:
https://stat.ethz.ch/pipermail/r-help/2008-May/162815.html )