-
Notifications
You must be signed in to change notification settings - Fork 83
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
fail uploading my shiny app #123
Comments
Thanks for reporting this! Can you paste the Chinese characters and/or the expression causing the problem into the issue? (We want to be sure we're testing with the same ones when we try to reproduce this, so we'll copy/paste from your text.) |
No problem! I'll provide an easy example below so that you can reproduce the same issue. Note: If I run If you need any further help to test Chinese character, please let me know. :)
|
Unfortunately I was not able to reproduce this! I deployed your app from a Windows machine without any problems. https://jonathan.shinyapps.io/shinychars/ Can you paste your RStudio version and sessionInfo()? |
Absolutely, @jmcphers . https://yenping.shinyapps.io/chinese_char_demo/ Here's my RStudio version and sessionInfo():
BTW, did you deploy the app successfully with one .R file (app.R), or deploy it with separate files (ui.R and server.R)? |
Looks like you're on an older version of the package -- rsconnect 0.4.5 is the latest. Do you still see the error with the newest version? |
Unfortunately the error still exists after installing the latest version of I loaded the Where could I possibly do wrong?
Here's my complete app.R file that was deployed to shinyapps.io:
https://yenping.shinyapps.io/hchart/ sessionInfo():
|
Hi, I have the same error (fail lint(), dependent libraries aren't installed) on Japanese UTF-8 characters. The errors occur both my file and following official script (https://github.com/rstudio/shiny-examples/tree/master/022-unicode-chinese). My file is attached (please rename .txt to .R). Regards,
|
Can you try explicitly marking the encoding as UTF-8? You should be able to do so with:
I can reproduce the errors seen when working within a Japanese locale + the default encoding option set ( |
Hi, Kevin Thank you for your reply. As I have seen following article, I didn't try setting options(encoding). Better to guide the following might be helpful. Regards, |
I wonder if Perhaps we can have an option |
Yes, that helps much. |
@jin-tkomoda: one other option that might be useful here -- what if you try setting This will tell R to assume that files are saved with UTF-8 encoding, and so the default behavior of the various 'read' routines will assume the files are saved with UTF-8 encoding (as opposed to the system encoding). Of course, R's handling of UTF-8 strings has some pitfalls on Windows so this will be a bandaid more than anything. |
Normally (of my usecase), all .R files are UTF-8. But some CSVs and some text-stream contain japanese local encodings, so it is unsuited for default setting. |
Hi, @kevinushey is there any news on this ? I encountered the same issue. It seems to come from
You could try Not sure how to deal with this. Encoding issue is not easy. I will open an issue in |
I think we want to specify the encoding directly in the Note that Note that the default argument we have is Here's a test script that illustrates this: options(encoding = "native.enc")
# write some UTF-8 encoded content to a file, preserving
# the UTF-8 encoding (don't attempt to re-encode)
contents <- "\"這是一個直方圖\""
tempfile <- tempfile()
writeLines(contents, con = tempfile, useBytes = TRUE)
# try parsing the file
parse(tempfile)
parse(tempfile)[[1]]
parse(tempfile, encoding = "UTF-8")
parse(tempfile, encoding = "UTF-8")[[1]]
# try parsing from a connection, but set the encoding
parse(file(tempfile))
parse(file(tempfile))[[1]]
parse(file(tempfile, encoding = "UTF-8"))
parse(file(tempfile, encoding = "UTF-8"))[[1]]
# convince ourselves we did write the content as UTF-8
input <- readChar(tempfile, file.info(tempfile)$size, useBytes = TRUE)
Encoding(input) <- "UTF-8"
input And the output I see:
tl;dr: Packrat should probably try parsing with |
When I try that with French on Windows, things are different as the file is not written initially in UTF-8 if I play your example options(encoding = "native.enc")
# write some content in French with special french character
contents <- "\"Sélectionner des pâtes dans sa tête\""
tempfile <- tempfile()
writeLines(contents, con = tempfile, useBytes = TRUE)
# check the encoding
input <- readChar(tempfile, file.info(tempfile)$size, useBytes = TRUE)
Encoding(input) <- "UTF-8"
input
Encoding(input) <- "Latin1"
input
# try parsing the file
parse(tempfile)
parse(tempfile)[[1]]
parse(tempfile, encoding = "UTF-8")
parse(tempfile, encoding = "UTF-8")[[1]]
parse(tempfile, encoding = "latin1")
parse(tempfile, encoding = "latin1")[[1]]
# try parsing from a connection, but set the encoding
parse(file(tempfile))
parse(file(tempfile))[[1]]
parse(file(tempfile, encoding = "UTF-8"))
parse(file(tempfile, encoding = "UTF-8"))[[1]]
parse(file(tempfile, encoding = "latin1"))
parse(file(tempfile, encoding = "latin1"))[[1]]
# try parsing with readLines
readLines(tempfile)
readLines(tempfile, encoding = "UTF-8")
readLines(tempfile, encoding = "Latin1") results
If I try to force writing to UTF-8 to create a UTF-8 file as tempfile <- tempfile()
contents_utf8 <- iconv(contents, to = "UTF-8")
Encoding(contents_utf8)
writeLines(contents_utf8, con = tempfile, useBytes = T)
input <- readChar(tempfile, file.info(tempfile)$size, useBytes = TRUE)
Encoding(input) <- "UTF-8"
input
# try parsing the file - nothing work
parse(tempfile)
parse(tempfile)[[1]]
parse(tempfile, encoding = "UTF-8")
parse(tempfile, encoding = "UTF-8")[[1]]
parse(tempfile, encoding = "latin1")
parse(tempfile, encoding = "latin1")[[1]]
# try parsing from a connection, but set the encoding
parse(file(tempfile))
parse(file(tempfile))[[1]]
parse(file(tempfile, encoding = "UTF-8"))
parse(file(tempfile, encoding = "UTF-8"))[[1]]
parse(file(tempfile, encoding = "latin1"))
parse(file(tempfile, encoding = "latin1"))[[1]] results
Initially I was thinking of using # Create a file with french comments and column name
contents <- c("library(tibble)", "#Création table", "tab <- tibble(scénario = 1:3, résultat = 1:3)")
tempfile_default <- tempfile()
# By default on my system, will be latin1
writeLines(contents, con = tempfile_default)
parse(tempfile_default)
parse(tempfile_default)[[1]]
parse(tempfile_default, encoding = "UTF-8")
parse(tempfile_default, encoding = "UTF-8")
# force UTF-8 for shiny requirement for example
tempfile_utf8 <- tempfile()
writeLines(iconv(contents, to = "UTF-8"), con = tempfile_utf8, useBytes = T)
parse(tempfile_utf8)
parse(tempfile_utf8)[[1]]
parse(tempfile_utf8, encoding = "UTF-8")
parse(tempfile_utf8, encoding = "UTF-8")
# nothing is working except if I defined file with encoding.
parse(file(tempfile_utf8, encoding = "UTF-8"))
parse(file(tempfile_utf8, encoding = "UTF-8"), encoding = "UTF-8") Results
file is being parsed. In this case, I need It could be an edge case, and I think the main solution is to set in Session InfosessionInfo()
#> R version 3.3.2 (2016-10-31)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 7 x64 (build 7601) Service Pack 1
#>
#> locale:
#> [1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252
#> [3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
#> [5] LC_TIME=French_France.1252
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] backports_1.1.0 magrittr_1.5 rprojroot_1.2 tools_3.3.2
#> [5] htmltools_0.3.6 yaml_2.1.14 Rcpp_0.12.11 stringi_1.1.5
#> [9] rmarkdown_1.6 knitr_1.17 stringr_1.2.0 digest_0.6.12
#> [13] evaluate_0.10.1 |
Hi, I have a error when I connect my RStudio with shinyapp.io . It tells me: Error in curl::curl_fetch_memory(url, handle = handle) : How can I solve this? |
Hello all, let me join in the fray. I have seen this warning
Now, I know that |
Hi! Any updates on the best way to do this? My ShinyApp reads in several csv files, most of them with non-ASCII characters (german Umlaute). I have saved all of the relevant r-scripts and csv files in UTF-8 encoding, and have also set options(encoding = "UTF-8") before deploying the App, but I still get this error message. |
Should be fixed by rstudio/packrat#647 |
Hi, I was trying to publish my shinyapp to shinyapps.io.
At first, I got this problem, and sort of figured it out by setting the encoding of the R object loading from .rda to UTF-8.
But the same problem shows when I have some Chinese character in the app.R file.
In short, the following will work:
However, this will not (adding some Chinese character in the string):
and here's the messages on console:
(I have already set the whole app.R file to UTF-8, but it doesn't work.)
Can you help me with this?
Thanks!
The text was updated successfully, but these errors were encountered: