New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chinese characters are not supported #296
Comments
@shangfr Do you have a small example plumber file? This way I can reproduce / fix the error you're seeing. Thank you in advance! |
@schloerke My plumber file was written in utf8,but the plumb function default encoding is ANSI , it should be better to specify encoding. Such as : plumb("plumber.R", encoding = "UTF-8") plumber.R#' Echo the parameter that was sent in $ curl "http://localhost:8000/echo?msg=hello&msgCN=你好" |
Note, this is only reproducible on Windows because the default encoding is not UTF-8. (Moreover, it may require a windows machine using Simplified Chinese. Replacing the Chinese by Latin-1 and it may be reproducible on any Windows machine.) There're actually two issues here:
A hotfix@shangfr you can use this as a hotfix for now. #' @get /echo2
function(msg="",msgCN=""){
Encoding(msgCN) <- "UTF-8" # by marking it explicitly it will work as an adhoc solution
list(msg = paste0("The message is: ", msg, "---","中文消息是: ",msgCN))
} |
… UTF-8 as the default related to rstudio#296
Thank you. I appreciate your help. Thanks. @shrektan |
Is there any way to set the character set so that the plumber can support Chinese characters?
谢谢!
The text was updated successfully, but these errors were encountered: