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

JSON Config and accented characters #2

Open
prof4natore opened this issue Nov 8, 2018 · 3 comments
Open

JSON Config and accented characters #2

prof4natore opened this issue Nov 8, 2018 · 3 comments

Comments

@prof4natore
Copy link

Hi,
inside my json config file i've a string with accented character like Operatività but when i try to read the file
with read.config it return to me this Operatività , some help please?
Thanks in advance

@Miachol
Copy link
Owner

Miachol commented Nov 8, 2018

Hi, here is my test output and did not repeat the issue you mentioned.

$ cat test.json
{
  "a":"Operatività"
}
$ Rscript -e "configr::read.config('test.json')"
$a
[1] "Operatività"

You can try to use the INI, YAML and TOML format files and check it again.
If the issue happens only in the JSON file, it is better to report it on jsonlite issues page.

If there are issues with all formats (JSON/YAML/INI/TOML), I guess you need to change or update the character encoding of R environment or operating system.

@prof4natore
Copy link
Author

Thanks for the response :), did you try it on windows?

@Miachol
Copy link
Owner

Miachol commented Nov 9, 2018

Here is my test output on windows:

> setwd(tempdir())
> configr::write.config(list(a="Operatività"), "test.json", "json")
[1] TRUE
> cat(paste0(readLines("test.json"), collapse = "\n"))
{
  "a": ["Operatività"]
}
> configr::read.config("test.json")
$`a`
[1] "Operatività"
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

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

loaded via a namespace (and not attached):
 [1] compiler_3.5.0 magrittr_1.5   RcppTOML_0.1.3 ini_0.3.1      tools_3.5.0    glue_1.3.0     yaml_2.1.19   
 [8] Rcpp_0.12.17   stringi_1.1.7  stringr_1.3.1  jsonlite_1.5   configr_0.3.3

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

2 participants