我正在本地计算机上编写一个闪亮的应用程序(ISO-8859-1是系统默认编码)。当我使用此编码保存ui.R并尝试运行应用程序时,与非UTF-8编码相关的错误会逐渐增加。因此,我使用UTF-8编码保存文件,如果文件中没有特殊字符,则应用。
特殊字符是墨西哥口音(á,é,í,ó),据说UTF-8支持。
如果我用UTF-8保存文件并再次打开它,我会将这些字符翻译成垃圾(?A等)。
我不确定我错过了什么。
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 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] broom_0.4.1 knitr_1.15.1 data.table_1.10.0 reshape2_1.4.2 RODBC_1.3-14 tse.sql_0.1.0
[7] memisc_0.99.7-1 MASS_7.3-45 lattice_0.20-34 foreign_0.8-67 magrittr_1.5 ggplot2_2.2.1
[13] inegiR_1.2.0 dplyr_0.5.0 tse.utils_0.1.0 shiny_0.14.2
loaded via a namespace (and not attached):
[1] zoo_1.7-13 splines_3.3.2 colorspace_1.2-7 sourcetools_0.1.5 htmltools_0.3.5 yaml_2.1.14
[7] mgcv_1.8-15 base64enc_0.1-3 XML_3.98-1.5 nloptr_1.0.4 DBI_0.5-1 plyr_1.8.4
[13] stringr_1.1.0 MatrixModels_0.4-1 munsell_0.4.3 gtable_0.2.0 psych_1.6.9 evaluate_0.10
[19] SparseM_1.74 httpuv_1.3.3 quantreg_5.29 pbkrtest_0.4-6 parallel_3.3.2 Rcpp_0.12.7
[25] xtable_1.8-2 scales_0.4.1 backports_1.0.4 jsonlite_1.2 mime_0.5 lme4_1.1-12
[31] mnormt_1.5-5 digest_0.6.10 stringi_1.1.2 grid_3.3.2 rprojroot_1.1 tools_3.3.2
[37] lazyeval_0.2.0 tibble_1.2 tidyr_0.6.0 car_2.1-4 Matrix_1.2-7.1 assertthat_0.1
[43] minqa_1.2.4 rmarkdown_1.3 R6_2.2.0 nnet_7.3-12 nlme_3.1-128