Skip to content

Commit

Permalink
don't enforce iconvlist()ed encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
bastistician committed Apr 11, 2024
1 parent e529cb2 commit 973dde5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/locale.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ check_tz <- function(x) {
check_encoding <- function(x) {
check_string(x, nm = "encoding")

if (tolower(x) %in% tolower(iconvlist())) {
## iconvlist() is not complete on all platforms,
## but encodings "latin1" and "UTF-8" are portable.
if (tolower(x) %in% tolower(c("latin1", "UTF-8", iconvlist()))) {
return(TRUE)
}

stop("Unknown encoding ", x, call. = FALSE)
warning("Unknown encoding ", x, call. = FALSE)
}

0 comments on commit 973dde5

Please sign in to comment.