From fa0eb4496cd234543d9b8050a54f963c770e859b Mon Sep 17 00:00:00 2001 From: Jack Wasey Date: Tue, 26 May 2020 06:50:01 -0400 Subject: [PATCH] UTF-8 WHO French decoding, fixes #192 Thanks to @patrickmdnet, actually fix part about UTF-8 decoding of French WHO data https://github.com/jackwasey/icd/pull/192/commits/a8b4a737c99313c380356c09181b96912882dc3c --- R/who.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/R/who.R b/R/who.R index 34117cb9..ba8818e9 100644 --- a/R/who.R +++ b/R/who.R @@ -70,7 +70,7 @@ ) } } # end 400+ - json_data <- rawToChar(http_response$content) + json_data <- httr::content(http_response, simplifyDataFrame=TRUE) jsonlite::fromJSON(json_data) } @@ -91,7 +91,8 @@ } #' Get the children of a concept (ICD-10 chapter, code or range) -#' @param concept_id NULl for root, concept string for any leaf or intermediate. +#' @param concept_id \code{NULL} for root, concept string for any leaf or +#' intermediate. #' @examples #' .dl_icd10who_children("XXII") #' .dl_icd10who_children("U84") @@ -301,5 +302,10 @@ } .downloading_who_message <- function() { - message("Downloading or parsing cached WHO ICD data. This may take a few minutes. Data is cached, so if there is a download error, repeating the instruction will return the data immediately if cached, or pick up where it left off.") # nolint + message(paste( + "Downloading or parsing cached WHO ICD data.", + "This may take a few minutes.", + "Data is cached, so repeating the command will return immediately,", + "or finish caching, then return." + )) }