kse-ua / KSE-Loc-Data-Hub

Building a Comprehensive Repository of Hromada-Level Data in Ukraine to Facilitate Research and Informed Policy Decisions. This repository supports the collection and accessibility of critical data at the hromada level in Ukraine for research and policy development.
https://kse.ua/kse-impact/center-for-sociological-research-decentralization-and-regional-development/
MIT License
10 stars 4 forks source link

Clarify the behavior of Cyrillic characters #16

Open andkov opened 2 years ago

andkov commented 2 years ago

When performing string manipulations on Ukrainian characters, it sometimes does not recognize and/or transforms the matched characters:

Sys.setlocale("LC_CTYPE", "russian")
Sys.setlocale("LC_CTYPE", "ukr")
d <- tibble::tribble(
  ~a , ~ b,
  "громада", "область"
)
d %>% mutate(a = str_remove(a,"гр"))

image

Please investigate this behavior and report possible solutions

Tytser commented 2 years ago

Did you try to perform this operation without setting the locale to ukr/rus? Because I get the right result despite errors for both Sys.setlocale commands image