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

Problems displaying Arabic characters: set locale to C.UTF-8 by default #27

Open
pverkind opened this issue Apr 2, 2021 · 0 comments
Open

Comments

@pverkind
Copy link

pverkind commented Apr 2, 2021

Hi,
I'm trying to set up a course for text mining of Arabic texts with R.

If I load an Arabic text in a fiddle, it is not rendered correctly in the Console: Arabic letters in the output are rendered as unicode code points between pointed brackets rather than letters (not that Arabic typed in the script is rendered correctly in the console as well):

image

I have found that the problem is with the locale, which is set to "C" by default (on my own machine, it is set to "C.UTF-8"): if I include a line Sys.setlocale(category = "LC_ALL", locale = "C.UTF-8") in the script of the fiddle, it displays correctly:

image

However, if I try to set the locale at the top of the RMarkdown document to C.UTF-8, this does not affect the output of the fiddle - I guess because the locale for the fiddle is on the Datacamp server?

```{r setup, include=FALSE}
tutorial::go_interactive()
Sys.setlocale(category = "LC_ALL", locale = "C.UTF-8")

Would it be possible to set the locale on the datacamp server to C.UTF-8 by default?

NB: I noted that by setting the locale in one fiddle, it also displayed Arabic correctly in another fiddle on the same page.

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

1 participant