mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
Ensure file encoding is specified for sort_c
This commit is contained in:
@@ -213,6 +213,10 @@ sortByName <- function(x) {
|
||||
# Sort a vector. If a character vector, sort using C locale, which is consistent
|
||||
# across platforms. Note that radix sort uses C locale according to ?sort.
|
||||
sort_c <- function(x, ...) {
|
||||
# Use UTF-8 encoding, because if encoding is "unknown" for non-ASCII
|
||||
# characters, the sort() will throw an error.
|
||||
if (is.character(x))
|
||||
x <- enc2utf8(x)
|
||||
sort(x, method = "radix", ...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user