I am trying to write a PhD thesis in TexStudio backended with biber & biblatex. I've been using JabRef to handle the bib file until several days ago. However decided to switch to Mendeley, but parsing a lot of PDFs often with hopeless metadata entries (as Mendeley struggled to cross reference them online) seems to have created some non-UTF8 encoded strings in my new bib file and now upon passing through biber during TexStudio build I am getting the following error:
INFO - This is Biber 2.15 (beta)
INFO - Logfile is 'Thesis.blg'
INFO - Reading 'Thesis.bcf'
INFO - Found 26 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'Bib/Mendeley/libraryjab.bib' for section 0
ERROR - Data file 'Bib/Mendeley/libraryjab.bib' cannot be read in encoding 'utf8': Wide character at C:\Users\user\AppData\Local\Temp\par-776f6c6665\cache-b32225defac3568d1e921af5a7245ca571b236aa\inc\lib/Win32/Unicode/File.pm line 163.
INFO - ERRORS: 1
I have checked the file, it is almost definitely UTF8 encoded itself (exported file has a comment line at the top confirming it), I tried saving it again as suggested here, which hasn't helped. I checked the preamble and the
\usepackage[utf8]{inputenc}
\usepackage
[backend=biber,
bibencoding=utf8]{biblatex}
are definitely there.
I ran the JabRef entry clean-up tool to convert all text fields to Unicode. No dice.
I even tried to use the older version of the bib file pre-dating switch to Mendeley - which DOES work fine with my .tex file, so the problem is most certainly with one/some of the new entries.
I also tried removing all of the files generated by the Build and Building again. Same problems persist. I have tried to manually prune whatever erroneous entries I could find, but I continue to get the error.
Is there a way I could to find and remove the wide characters causing the problem in my .bib file?
There are hundreds of references so I'd rather avoid continuing to investigate them manually.
cat input.bib | iconv -f utf-8 -t latin1 -c | iconv -f latin1 -t utf-8 > output.bibmaybe? – Oleg Lobachev Oct 14 '20 at 21:23bibfile into smaller chunks that biber can cope with makes any sense for a lengthy bibliography that I'll end up having. – Wolfe79 Oct 14 '20 at 21:35