I have tried to create Shiny application, which supposed to produce ANOVA post-hoc table with mean values followed by standard deviations and separated by plus-minus sign (±). Everything works nice in RStudio environment and when aplication is reproduced in local web-server (both, render and download). Even when I try to run application on Shiny server it renders correct table to HTML, but when I try to download table as .csv downloadHandler introduces a strange character (Â) in front of plus-minus sign. How can I override this strange sign introduction? I have tried to enforce "UTF-8" encoding in many different places in code, but with no success. Moreover, I have tries everything what is specified in Unicode characters in Shiny apps, but again with no success. The complete code is included within the application (showcase). Sample table for running application could be found here, and downloaded table with introduced Â's could be found here (special character  is not visible at GitHub view for some reason, but when you download it it becames visible).
Asked
Active
Viewed 328 times
0
-
1Have you seen [this question](http://stackoverflow.com/questions/1461907/html-encoding-issues-%C3%82-character-showing-up-instead-of-nbsp)? It's not about shiny, but it does discuss the spontaneous appearance of A-circumflex characters immediately before unusual characters. – Paul de Barros May 16 '17 at 17:51
-
1Also, [this site](http://www.i18nqa.com/debug/utf8-debug.html) specifically mentions the issue of `±` turning into `±`. – Paul de Barros May 16 '17 at 17:57
-
Thank you @Paul for your suggestions. There are plenty of explanations about utf-8 encoding issues, but unfortunately I couldn't find right answer there. But you encouraged me to search more deeply. [Here](http://stackoverflow.com/questions/34936168/r-shiny-download-data-encoding-issue), I have found what I was looking for. Now, when I have put encoding parameter in import file line `read.csv(infile$datapath, header = TRUE, encoding = "UTF-8")` and encoding for exporting file line `write.csv(tableInput(), file, row.names=FALSE, fileEncoding = "latin1")`, everything works just nice. – Dejan Pljevljakusic May 18 '17 at 06:54