Skip to content

[Q&A]: How can we learn the locale used in webr? #238

@homerhanumat

Description

@homerhanumat

What's your question?

As best I can tell from online documentation, when R is installed via WASM the default locale is a C-type, and it is unclear to me that a user can change this. But render this document and run the code-fields:

---
title: "Test"
format: html
filters:
  - webr
---


```{r}
# On my machine, the locale is en_US.UTF-8:
Sys.getlocale("LC_COLLATE")
```

```{webr-r}
# webr-r will also report en_US.UTF-8
Sys.getlocale("LC_COLLATE")
```



```{r}
## in en_US.UTF-8 the following evaluates to TRUE
"a" < "B"
```

```{webr-r}
# but the WASM installation appears to use a C-type locale:
"a" < "B"
```

How can one get webr to report the locale that is actually being used?

The behavior is the same on several browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions