Dienstag, 16. April 2024
latex2
diegolego, 00:05h
Another problem that I encountered with LaTeX was encoding. People provided messy .bib files and I copied the necessary entries into a single file. After removing illegal characters. I got the following message.
> ERROR - Data file '... .bib' cannot be read in encoding 'utf8': Can't decode ill-formed UTF-8 octet sequence at /usr/lib/perl5/vendor_perl/5.26.1/File/Slurper.pm line 59.
Searching for the error message brought me to this explanation. Apparently, it means that my .tex and .bib files have different encodings. On this website I found that the encoding can be checked with "file -i" and it can be changed with
> iconv -f iso-8859-1 -t utf-8 bib1.bib -o bib2.bib
which solved the problem.
Again, overleaf ignored any errors. I guess the idea is not to frustrate latex beginners, but the consequence is that they generate sloppy latex-sources.
Update: mendely creates the worst bib-files
> ERROR - Data file '... .bib' cannot be read in encoding 'utf8': Can't decode ill-formed UTF-8 octet sequence at /usr/lib/perl5/vendor_perl/5.26.1/File/Slurper.pm line 59.
Searching for the error message brought me to this explanation. Apparently, it means that my .tex and .bib files have different encodings. On this website I found that the encoding can be checked with "file -i" and it can be changed with
> iconv -f iso-8859-1 -t utf-8 bib1.bib -o bib2.bib
which solved the problem.
Again, overleaf ignored any errors. I guess the idea is not to frustrate latex beginners, but the consequence is that they generate sloppy latex-sources.
Update: mendely creates the worst bib-files