Can`t paste\print Russian symbols into console but cat is working

for example i have the code below

Sys.getlocale()
Sys.setlocale("LC_ALL", locale = "Russian")
A <- 'абвгд'
paste(A, sep = '!')
print(A)

the result of code execution is:

> Sys.getlocale()
[1] "LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252"
Warning message:
In load(path, envir = .GlobalEnv) :
  strings not representable in native encoding will be translated to UTF-8
> Sys.setlocale("LC_ALL", locale = "Russian")
[1] "LC_COLLATE=Russian_Russia.1251;LC_CTYPE=Russian_Russia.1251;LC_MONETARY=Russian_Russia.1251;LC_NUMERIC=C;LC_TIME=Russian_Russia.1251"
> A <- 'АБВГД'
> paste(A, sep = '!')
[1] "\u0410\u0411\u0412\u0413\u0414"
> print(A)
[1] "\u0410\u0411\u0412\u0413\u0414"
> cat(A)
АБВГД

I tried everything what I found in Google, nothing helped to solve this problem .
Also I tried change system locale in: control panel->Region->Administrative->Change system locale->Russian (Russia) and ticked "Beta: Use Unicode UTF-8 for worldwide language support"
Besides I tried to change file encoding into UTF-8 and Global Options->Code->Saving->Default text Encoding UTF-8, Line encoding conversion Platform Native. Into Project Options->Code Editing->Line encoding conversion->Use Default, Text encoding->UTF-8
I really hope for your help.

A <- 'абвгд'
A
#> [1] "абвгд"
paste(A,A,sep = "!")
#> [1] "абвгд!абвгд"
sessionInfo()
#> R version 4.0.4 (2021-02-15)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Pop!_OS 20.10
#> 
#> Matrix products: default
#> BLAS:   /usr/local/lib/R/lib/libRblas.so
#> LAPACK: /usr/local/lib/R/lib/libRlapack.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] knitr_1.31        magrittr_2.0.1    debugme_1.1.0     rlang_0.4.10     
#>  [5] fansi_0.4.2       stringr_1.4.0     styler_1.3.2      highr_0.8        
#>  [9] tools_4.0.4       xfun_0.22         utf8_1.2.1        htmltools_0.5.1.1
#> [13] ellipsis_0.3.1    yaml_2.2.1        digest_0.6.27     tibble_3.1.0     
#> [17] lifecycle_1.0.0   crayon_1.4.1      purrr_0.3.4       vctrs_0.3.6      
#> [21] fs_1.5.0          glue_1.4.2        evaluate_0.14     rmarkdown_2.7    
#> [25] reprex_1.0.0      stringi_1.5.3     compiler_4.0.4    pillar_1.5.1     
#> [29] backports_1.2.1   pkgconfig_2.0.3

@technocrat The result of this code is:

> A <- 'абвгд'
> A
[1] "\u0430\u0431\u0432\u0433\u0434"
> paste(A,A,sep = "!")
[1] "\u0430\u0431\u0432\u0433\u0434!\u0430\u0431\u0432\u0433\u0434"
> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    
system code page: 65001

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

loaded via a namespace (and not attached):
[1] compiler_4.0.4 tools_4.0.4

Try

install.packages("utf8")

Sorry I can't test this, since I don't have a Window box

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.