albertosantini / node-rio

Integration with Rserve, a TCP/IP server for R framework
https://github.com/albertosantini/node-conpa
MIT License
176 stars 35 forks source link

about utf8 chars in R source file #2

Closed ghost closed 11 years ago

ghost commented 11 years ago

when It encountered a utf8 chars in source file, got something wrong from Rserve, expression(s) evaluated (Rerror=0). Unknown type: 3 Type SEXP 18 Type 18 is currently not implemented Response value: false false Disconnected from Rserve Closed from Rserve is there any way to fix it? because i am not good at R.

albertosantini commented 11 years ago

Thanks for the feedback.

https://github.com/albertosantini/node-rio/blob/master/lib/rio.js#L321

I read the file with ascii encoding.

I will fix it with utf-8 in the next hours. :)

ghost commented 11 years ago

thanks for so fast response, and I have a suggestion for you: could you integerate the RJSON into the sourceAndEval, both fromJSON and toJSON, like this library(RJSONIO) run <- function (input) { i <- fromJSON(input) o <- entryPoint(i) toJSON(o) }

so when we coding R, justing useing R object input as mentioned up with 'o'

albertosantini commented 11 years ago

Nice suggestion.

Basically you would remove in R scripts the following lines:

o = fromJSON(jsonObj)

and

return(toJSON(res))

I will give a look at it.

albertosantini commented 11 years ago

I can reproduce the issue, but the encoding change is not enough.

I need to debug it in depth.

albertosantini commented 11 years ago

I pushed in the master the fix for utf8.

Please, pull the changes and feel free to test it.

ghost commented 11 years ago

thanks, great!

ghost commented 11 years ago

thanks again, remember to publish to npm.