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

Issue with some utf8 strings and windows #23

Open
lepennec opened this issue Dec 23, 2021 · 1 comment
Open

Issue with some utf8 strings and windows #23

lepennec opened this issue Dec 23, 2021 · 1 comment

Comments

@lepennec
Copy link

Hi,

it seems there is an issue with (at least certain utf8) strings in windows:

gridtext::richtext_grob("Любовь")

is producing a warning:

richtext_grob[GRID.richtext_grob.15] 
Warning messages:
1: In text_info(label, fontkey, fontfamily, fontface, fontsize, cache) :
  unable to translate '<U+041B><U+044E><U+0431><U+043E><U+0432><U+044C>RStudioGD12' to native encoding
2: In do.call(gList, grobs) :
  unable to translate '<U+041B><U+044E><U+0431><U+043E><U+0432><U+044C>' to native encoding

My impression is that the issue in text_info is related to the cache. Indeed:

text_info_cache <- new.env(parent = emptyenv())
 text_info_cache[["Любовь"]]

yields

NULL
Warning message:
unable to translate '<U+041B><U+044E><U+0431><U+043E><U+0432><U+044C>' to native encoding 

Note that I did not have this issue under Linux...

Let me know if I can help.

@bwiernik
Copy link
Collaborator

If this is a version of R before 4.2, handling of UTF-8 characters on Windows-R is very bad. The easiest solution would be to upgrade to R 4.2.

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