Skip to content

Commit

Permalink
If BibTeX file is in UTF-8 declare the strings as such
Browse files Browse the repository at this point in the history
References ropensci#75.
  • Loading branch information
mbojan committed May 13, 2020
1 parent 4dd720a commit 963b59f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/ReadBib.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ ReadBib <- function(file, .Encoding = "UTF-8",
srcfile(file, encoding = .Encoding))

out <- do_read_bib(file, encoding = .Encoding, srcfile)
if(identical(.Encoding, "UTF-8")) {
# Declare UTF-8 of the strings if it is so
out <- lapply(out, function(x) {Encoding(x) <- "UTF-8"; x})
}
at <- attributes(out)
if (typeof(out) != "integer")
out <- lapply(out, MakeBibEntry)
Expand Down

0 comments on commit 963b59f

Please sign in to comment.