1

I have a Encoding Problem in KNIME.

Following code works perfectly in RStudio, the symbol ° is printed out correctly.

library(grid)
library(gridBase)
library(gridExtra)
library(ggplot2)

fn <- "C:/Temp/textR.pdf"
pdf(file=fn)
df <- data.frame("crit °C", 1)
g1 <- tableGrob(format(df, core.just="left"))
grid.arrange(g1,  ncol = 1)
dev.off()

I want to use this code in an R Snippet in KNIME, unfortunately it won´t work there, instead of "°" I get "°".

What i already tried:

Can anyone help me? I am using KNIME 3.1.1 and R_3_2_1

Community
  • 1
  • 1
johntechendso
  • 233
  • 1
  • 3
  • 10

1 Answers1

0

It was working well for me (also Windows, in my case Windows 10, 64 bit, English locale, KNIME 3.1.2, R 3.0.3).

You might give a try with the following change:

df <- data.frame("crit \u00B0C", 1)

(\u00B0 stands for the unicode degree sign.)

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
  • THANKS! nice workaround, for variables u can achieve by just replacing the character: unit_symbol <- gsub("°", "\u00B0", unit_symbol) – johntechendso Jul 02 '16 at 07:50