Problem with using Cyrillic letters in URL in shinyapps.io

I want to create a multipage dashboard using a flexdashboard with shiny. I deployed my dashboard on shinyapps.io, but I can’t open pages with titles in Russian (pages named in English are ok). I think this is because of some problems with using Cyrillic symbols in URL. Is it possible to use Russian titles of pages on my dashboard?

https://evgeniia-volkova.shinyapps.io/dashboard/

---
title: "Title"
output: 
  flexdashboard::flex_dashboard:
  orientation: columns
runtime: shiny
---
Page 1
====================================
Column 
------------------------------------
Column
------------------------------------
### Заголовок
### Заголовок

Страница 2
====================================
Column 
------------------------------------
### Заголовок
Column 
------------------------------------
### Заголовок

Страница 3
====================================
Column
------------------------------------
### Заголовок
### Заголовок
Column
------------------------------------
### Заголовок
### Заголовок

Page 4
====================================
Column
------------------------------------
### Заголовок
### Заголовок
Column
------------------------------------
### Заголовок

Interesting issue. When I view one of the Cyrillic tabs, I see this in the Javascript console:

jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: #section-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0-2
at Function.se.error (jquery.min.js:2)
at se.tokenize (jquery.min.js:2)
at se.select (jquery.min.js:2)
at Function.se [as find] (jquery.min.js:2)
at k.fn.init.find (jquery.min.js:2)
at new k.fn.init (jquery.min.js:2)
at k (jquery.min.js:2)
at c.show (:7:1078)
at HTMLAnchorElement. (:7:583)
at Function.each (jquery.min.js:2)
se.error @ jquery.min.js:2
se.tokenize @ jquery.min.js:2
se.select @ jquery.min.js:2
se @ jquery.min.js:2
find @ jquery.min.js:2
k.fn.init @ jquery.min.js:2
k @ jquery.min.js:2
c.show @ VM38:7
(anonymous) @ VM38:7
each @ jquery.min.js:2
each @ jquery.min.js:2
b @ VM38:7
e @ VM38:7
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

I don't know if it is the cause or a red-herring, but the version of jquery served from shinyapps.io is 3.4.1, while the version served when running the document from RStudio 1.2.5001 locally is 1.12.4.

Deploying myself doesn't seem to have reproduced either. Could you add the following to one of your tabs:

```{r}
sessionInfo()
```

I am curious what your deployed locale is such that your anchor link is "#section-страница-2" while mine is "#section-section-2".

Try setting the option rsconnect.locale to "en_US.UTF-8" or "ru_RU.UTF-8" or "C.UTF-8" and re-deploy.

Did it. It’s an interesting thing. When I run my app locally I get my locale is
[1] LC_COLLATE=English_United States.1252 (I set it by Sys.setlocale(“LC_ALL”, “English”) – only this code helped to change something). Platform: x86_64-w64-mingw32/x64 (64-bit). Running under: Windows 8.1 x64 (build 9600).

But when I deployed my app, I’ve got Platform: x86_64-pc-linux-gnu (64-bit), Running under: Ubuntu 16.04.6 LTS, locale: [1] LC_CTYPE=en_US.UTF-8.

I've tried a lot of variations with sys.setlocale() and I also set option rsconnect.locale to "en_US.UTF-8"/ "ru_RU.UTF-8"/"C.UTF-8", but the result is the same.

Yes, shinyapps.io servers run Ubuntu, so that is unsurprising to me.

Perhaps one of the developers of flexdashboard could assist with other things to try, @barret?

1 Like

@EvV Thank you for the reprex document!

I've added a flexdashboard PR here: https://github.com/rstudio/flexdashboard/pull/255

This should be fixed in the next release.

Thank you!

2 Likes

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

Thank you! Great news that my app can work with Russian page titles! Apparently, the problem is related to my system locale. I received

R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251
[3] LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C
[5] LC_TIME=Russian_Russia.1251

I have tried to change system locale by Sys.setlocale("LC_ALL", 'en_US.UTF-8'), but it didn't work. Also I tried to change locale by Windows settings but only one language (Russian) is available to my system. Maybe I can try something else?

Unfortunately it did not work.

Could you place sessionInfo() in one of the tabs so we can interactively view the information?
I want to verify that the locale is successfully being picked up by the rsconnect package. If it isn't, we can pull one of the developers into the conversation.