diff --git a/DESCRIPTION b/DESCRIPTION index 94cc305fe..0e3b02784 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: stringi Version: 1.5.4 -Date: 2021-03-02 +Date: 2021-04-07 Title: Character String Processing Facilities Description: A multitude of character string/text/natural language processing tools: pattern searching (e.g., with 'Java'-like regular diff --git a/NEWS b/NEWS index 6d0ed3d89..5a7bcc3a4 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ * [INTERNAL] #414: Use `LEVELS(x)` macro instead of accessing `(x)->sxpinfo.gp` directly (@lukaszdaniel). +* [BUGFIX] #415: `locale=''` was not equivalent to `locale=NULL` + in `stri_opts_collator()`. + * ... (to do) ..., for example: #25 (locate-capture groups), #31 (sub_index), @@ -24,7 +27,7 @@ ## 1.5.3 (2020-09-04) **CRAN** * [DOCUMENTATION] stringi home page has moved to https://stringi.gagolewski.com - and now includes the comprehensive reference manual. + and now includes a comprehensive reference manual. * [NEW FEATURE] #400: `%s$%` and `%stri$%` are now binary operators that call base R's `sprintf()`. diff --git a/src/stri_collator.cpp b/src/stri_collator.cpp index c404b8a6e..844a3db39 100644 --- a/src/stri_collator.cpp +++ b/src/stri_collator.cpp @@ -74,7 +74,7 @@ UCollator* stri__ucol_open(SEXP opts_collator) if (narg <= 0) { // no custom settings - use default Collator UErrorCode status = U_ZERO_ERROR; - UCollator* col = ucol_open(NULL, &status); + UCollator* col = ucol_open(uloc_getDefault(), &status); STRI__CHECKICUSTATUS_RFERROR(status, {/* do nothing special on err */}) // error() allowed here return col; } @@ -93,7 +93,7 @@ UCollator* stri__ucol_open(SEXP opts_collator) UColAttributeValue opt_STRENGTH = UCOL_DEFAULT_STRENGTH; UColAttributeValue opt_NUMERIC_COLLATION = UCOL_DEFAULT; // USearchAttributeValue opt_OVERLAP = USEARCH_OFF; - const char* opt_LOCALE = NULL; + const char* opt_LOCALE = uloc_getDefault(); for (R_len_t i=0; i