Skip to content

Commit

Permalink
ensure encoding is updated in safe_compress
Browse files Browse the repository at this point in the history
  • Loading branch information
parmsam committed Apr 10, 2024
1 parent 1dfba14 commit 6034bd8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/lzstringr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ safe_compress <- function(string, f) {
string <- iconv(string, from="UTF-8", to="UTF-16", toRaw=TRUE)[[1]]
result <- f(string)
chr_result <- rawToChar(as.raw(result))
Encoding(chr_result) <- "UTF-8"
chr_result
}

Expand Down

0 comments on commit 6034bd8

Please sign in to comment.