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 Apr 18, 2021
1 parent 5a8a874 commit b8a48aa
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 @@ -53,6 +53,10 @@ ReadBib <- function(file, .Encoding = "UTF-8",
srcfile(file, encoding = .Encoding))

out <- bibtex::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 b8a48aa

Please sign in to comment.