0

I have problem with saveworkbook and my result. I create an excel file with currency using createstyle(nmFmt='# ##0.00 zł') and createstyle(nmFmt='# ##0.00 €') etc. and then I use saveWorkbook(wb, xxx). In my result I see specific symbols lika a €, £ and zł when I run manually by Rstudio - everything is ok.

Then I create task by package taskscheduleR and my excel file has something like a ⬠or zÂ.

TaskscheduleR run program by cmd. SessionInfo give(): system code page: 65001

I have marked also "Beta: Use Unicode UTF-8 for worldwide language support" in Administrative Settings.

Could you solve this task?

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

0

It's all about encoding, maybe some kind of mojibake:

x <- 'z\u0142 £ €'
Encoding(x)
x
Encoding(x) <- 'latin2'
x
Encoding(x) <- 'UTF-8'
x

Result (paste above code snippet to the RStudio console):

> 
> x <- 'z\u0142 £ €'
> Encoding(x)
[1] "UTF-8"
> x
[1] "zł £ €"
> Encoding(x) <- 'latin2'
> x
[1] "zł £ €"
> Encoding(x) <- 'UTF-8'
> x
[1] "zł £ €"
> 
JosefZ
  • 28,460
  • 5
  • 44
  • 83
  • Yep, many thanks! I tried change regedit cmd.exe but that problem was simpler than I thought. I put in my code unicode of this symbol "numFmt='# ##0.00 z\u0142" :) – Shigerusam Apr 22 '21 at 16:21