#' Query Data ILOSTAT
#'
#' fix utf-8 encoding bug
#'
#' Helper function to efficiently query data from ILOSTAT SDMX API.
#'
#' @param Str a character vector with UTF-8 encoding errors.
#' @author ILO bescond
#' @keywords ILO, SDMX, R
#' @export
#' @examples
#' ################################# use to identify correct 'DSD'
#' test <- c("emquête", "Ménage")
#' recodeChar(test)
recodeChar <- function(Str){
Encoding(Str) <- "UTF-8"
for (i in 1:nrow(Ariane:::charsets)) {
Str <- gsub(Ariane:::charsets$Actual[i], Ariane:::charsets$Unicode[i], Str, fixed = TRUE)
}
for (i in 1:nrow(Ariane:::charsets)) {
Str <- gsub(Ariane:::charsets$Unicode[i],Ariane:::charsets$Expected[i], Str, fixed = TRUE)
}
Str
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.