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

warning in parse_date_time() when a locale is set #1141

Open
alusiani opened this issue Oct 5, 2023 · 0 comments
Open

warning in parse_date_time() when a locale is set #1141

alusiani opened this issue Oct 5, 2023 · 0 comments

Comments

@alusiani
Copy link

alusiani commented Oct 5, 2023

If a locale is set, parse_date_time() issues warnings for any string.

Minimal reproducible example:

suppressMessages(library(lubridate))

rc = Sys.setlocale(category = "LC_TIME", locale = "it_IT")
print(as.Date(parse_date_time("30/04/2022", "dmY")))

Undue warnings appear:

[1] "2022-04-30 UTC"
Warning messages:
1: In strsplit(L, "@", fixed = TRUE) : input string 1 is invalid UTF-8
2: In strsplit(L, "@", fixed = TRUE) : input string 2 is invalid UTF-8
3: In strsplit(L, "@", fixed = TRUE) : input string 3 is invalid UTF-8
4: In strsplit(L, "@", fixed = TRUE) : input string 5 is invalid UTF-8
5: In strsplit(L, "@", fixed = TRUE) : input string 6 is invalid UTF-8

sessionInfo()

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora Linux 38 (KDE Plasma)

Matrix products: default
BLAS/LAPACK: FlexiBLAS OPENBLAS-OPENMP;  LAPACK version 3.11.0

locale:
 [1] LC_CTYPE=en_IE.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=it_IT              LC_COLLATE=en_IE.UTF-8    
 [5] LC_MONETARY=en_IE.UTF-8    LC_MESSAGES=en_IE.UTF-8   
 [7] LC_PAPER=en_IE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_IE.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Rome
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lubridate_1.9.2 devtools_2.4.5  usethis_2.2.2  

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1    compiler_4.3.1    crayon_1.5.2      promises_1.2.0.1 
 [5] Rcpp_1.0.11       stringr_1.5.0     callr_3.7.3       later_1.3.1      
 [9] fastmap_1.1.1     mime_0.12         R6_2.5.1          generics_0.1.3   
[13] htmlwidgets_1.6.2 profvis_0.3.8     shiny_1.7.4.1     rlang_1.1.1      
[17] cachem_1.0.8      stringi_1.7.12    httpuv_1.6.11     fs_1.6.3         
[21] pkgload_1.3.2.1   timechange_0.2.0  memoise_2.0.1     cli_3.6.1        
[25] magrittr_2.0.3    ps_1.7.5          digest_0.6.33     processx_3.8.2   
[29] xtable_1.8-4      remotes_2.4.2.1   lifecycle_1.0.3   prettyunits_1.1.1
[33] vctrs_0.6.3       glue_1.6.2        urlchecker_1.0.1  sessioninfo_1.2.2
[37] pkgbuild_1.4.2    purrr_1.0.1       tools_4.3.1       ellipsis_0.3.2   
[41] htmltools_0.5.5  
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