[chronojump] Fixed latin chars on encoder graphs on Windows



commit e743055d1c44879070ec189f3ed3a39d828cf8f4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Nov 8 01:10:23 2015 +0100

    Fixed latin chars on encoder graphs on Windows

 encoder/graph.R |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index a455e77..cbe97b0 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -82,8 +82,16 @@ cols=c(colSpeed,colForce,colPower); lty=rep(1,3)
 translate <- function(englishWord) {
        if(length(Translated[which(English == englishWord)]) == 0)
                return (englishWord) #not found, return english word
-       else
-               return(Translated[which(English == englishWord)])
+       else {
+               myWord = Translated[which(English == englishWord)]
+       
+               #Needed conversion for Windows:
+               #unicoded titles arrive here like this "\\", convert to "\", as this is difficult, do like 
this:
+               #http://stackoverflow.com/a/17787736
+               myWord = parse(text = paste0("'", myWord, "'"))
+       
+               return(myWord)
+       }
 }
 
 translateVector <- function(englishVector) {
@@ -2144,7 +2152,7 @@ doProcess <- function(options)
        op <- assignOptions(options)
        
        print(c("1 Title=",op$Title))
-       #unicoded titles arrive here like this "\\", convert to "\", as this is difficoult, do like this:
+       #unicoded titles arrive here like this "\\", convert to "\", as this is difficult, do like this:
        #http://stackoverflow.com/a/17787736
        op$Title=parse(text = paste0("'", op$Title, "'"))
        print(c("1 Title=",op$Title))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]