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

Match failure when LC_COLLATE is not UTF-8 #5

Open
gagolews opened this issue Apr 23, 2016 · 1 comment
Open

Match failure when LC_COLLATE is not UTF-8 #5

gagolews opened this issue Apr 23, 2016 · 1 comment

Comments

@gagolews
Copy link

e.g., Windows does not have a UTF-8 locale set by default

@gagolews gagolews changed the title TO DO: test if LC_COLLATE is not UTF-8 TO DO: test when LC_COLLATE is not UTF-8 Apr 23, 2016
@gagolews
Copy link
Author

Now the behavior is incorrect:

[gagolews@zeus tmp]$ LC_ALL="pl_PL.iso-8859-2" R

R Under development (unstable) (2016-04-14 r70486) -- "Unsuffered Consequences"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

> library("stringi")
> x <- stri_conv("a\u0105bc", "UTF-8", "")
> library(re2r) 
> re2_match("\u0105", x)
[1] FALSE
> re2_match(x, "\u0105")
B��D: invalid UTF-8 in regexp: 
> stri_extract_all_regex(x, "\u0105")    # this is OK
[[1]]
[1] "�"

consider converting all input strings to utf8, preferably with `stringi::stri_enc_toutf8``

@gagolews gagolews changed the title TO DO: test when LC_COLLATE is not UTF-8 Match failure when LC_COLLATE is not UTF-8 Apr 23, 2016
qinwf pushed a commit that referenced this issue May 2, 2016
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