Skip to content

Commit

Permalink
Merge pull request #26 from pawelru/fix_bom
Browse files Browse the repository at this point in the history
Fix bom
  • Loading branch information
parmsam authored Oct 3, 2024
2 parents 126cec0 + 9650d20 commit df2304c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/lzstringr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NULL
convert_to_utf16le <- function(string) {
string <- enc2utf8(string)
string_utf16 <- iconv(string, from = "UTF-8", to = "UTF-16LE", toRaw = TRUE)[[1]]
bom_le <- charToRaw("\xFF\xFE")
bom_le <- as.raw(c(0xFF, 0xFE))
if (!identical(string_utf16[1:2], bom_le)) {
string_utf16 <- c(bom_le, string_utf16)
}
Expand Down

0 comments on commit df2304c

Please sign in to comment.