gagolews / gagolews/stringi

Collation: case_level doesn't seem to work properly to ignore accents but take case into account (ICU StringSearch and UCollator; UCOL_STRENGTH=UCOL_PRIMARY, UCOL_CASE_LEVEL=UCOL_ON)

Open
#415 13 comments 0 reactions 0 assignees View on GitHub
bug ICU-related
Dominant language
C++
Stars
318
Forks
48
PR merge metrics
No merged PRs in 30d

Description

According to the [Unicode Technical Standard #35](http://www.unicode.org/reports/tr35/tr35-collation.html#Case_Parameters), when case Level is set to On and strength set to primary, ICU should ignore accents but take case into account. This is not the behavior I find in `stringi` package. To achieve that, I have to set locale = "", which is not what I expected. Examples:

This is ok:

```
stringi::stri_detect_coll("Mário", "mario", strength = 1L)
[1] TRUE
```
This should return FALSE:
```
stringi::stri_detect_coll("Mário", "mario", strength = 1L,case_level = TRUE)
[1] TRUE
```
In order to achieve that I need to set locale to "" on `stringi`:

```
stringi::stri_detect_coll("Mário", "mario", strength = 1L, locale = "")
[1] FALSE

```
Here I respect case but don't add accent and get the expected result:

```
stringi::stri_detect_coll("Mário", "Mario", strength = 1L, locale = "")
[1] TRUE
````

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.