Skip to content
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

Problem with Unicode on Windows #37

Closed
kferris10 opened this issue Apr 2, 2015 · 6 comments
Closed

Problem with Unicode on Windows #37

kferris10 opened this issue Apr 2, 2015 · 6 comments

Comments

@kferris10
Copy link

I am running into an issue with creating gists with unicode characters.

The characters are mangled when I try this code:

library(curl)
d3 <- "https://github.com/mbostock/d3/archive/v3.0.6.zip"
tmp <- tempfile()
curl::curl_download(d3, tmp, mode = "wb")
unzip(tmp)
unlink(tmp)

library(gistr)
gistr::gist_create(files = "d3-3.0.6/d3.js")

This might be a Windows issue because the same code works fine for @cpsievert .

> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gistr_0.1.0 curl_0.5   

loaded via a namespace (and not attached):
 [1] bitops_1.0-6    digest_0.6.8    evaluate_0.5.5  formatR_1.0    
 [5] httpuv_1.3.2    httr_0.6.1      jsonlite_0.9.14 knitr_1.9      
 [9] magrittr_1.5    R6_2.0.1        Rcpp_0.11.4     RCurl_1.95-4.5 
 [13] stringr_0.6.2   tools_3.1.3 
@sckott
Copy link
Contributor

sckott commented Apr 2, 2015

@kferris10 taking a look now, thanks for the report

@sckott
Copy link
Contributor

sckott commented Apr 2, 2015

@kferris10 Can you reinstall from github and try again? I tested on on my windows virtual machine, and worked for me:

devtools::install_github("ropensci/gistr")
....etc. 

@sckott
Copy link
Contributor

sckott commented Apr 2, 2015

@benmarwick do you think you could test the above ex? i think you're on windows?

@benmarwick
Copy link
Contributor

Characters look good to me, using windows:

devtools::install_github("ropensci/gistr")
library(curl)
d3 <- "https://github.com/mbostock/d3/archive/v3.0.6.zip"
tmp <- tempfile()
curl::curl_download(d3, tmp, mode = "wb")
unzip(tmp)
unlink(tmp)

library(gistr)
gistr::gist_create(files = "d3-3.0.6/d3.js")

Results in this: https://gist.github.com/benmarwick/7efe4346ce99cc63e3df

d3 = function() {
  var π = Math.PI, ε = 1e-6, d3 = {
    version: "3.0.6"
  }, d3_radians = π / 180, d3_degrees = 180 / π, d3_document = document, d3_window = window;
  function d3_target(d) {
    return d.target;
... etc. etc.

My session info:

> sessionInfo()
R version 3.2.0 alpha (2015-03-25 r68091)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gistr_0.1.3.9999 curl_0.5        

loaded via a namespace (and not attached):
 [1] Rcpp_0.11.5       digest_0.6.8      dplyr_0.4.1       assertthat_0.1    bitops_1.0-6      R6_2.0.1         
 [7] jsonlite_0.9.15   DBI_0.3.1         magrittr_1.5      formatR_1.1       evaluate_0.5.5    httr_0.6.1       
[13] rstudioapi_0.2    rmarkdown_0.5.3.1 devtools_1.7.0    tools_3.2.0       stringr_0.6.2     RCurl_1.95-4.5   
[19] httpuv_1.3.2      parallel_3.2.0    yaml_2.1.13       htmltools_0.2.6   knitr_1.9

@sckott
Copy link
Contributor

sckott commented Apr 3, 2015

great, thanks @benmarwick , let me know if it works for you @kferris10 and i'll close this

@kferris10
Copy link
Author

It works perfectly using the version on github. Thanks! Sorry for the confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants