Closed jimcarst closed 2 years ago
To fix, change all uses of open
to include encoding.
For example, in journal_abbrev.py
:
with open(this_dir / "data/journals.json") as f:
becomes with open(this_dir / "data/journals.json", encoding='utf-8') as f:
Thanks, this was really helpful! Fixed the problem!
To fix, change all uses of
open
to include encoding.For example, in
journal_abbrev.py
:with open(this_dir / "data/journals.json") as f:
becomeswith open(this_dir / "data/journals.json", encoding='utf-8') as f:
I have modified all uses of open
, but still get:
File "D:\psnProgram\anaconda\lib\site-packages\betterbib\tools.py", line 543, in bibtex_parser
data = bibtex.Parser().parse_file(infile)
File "D:\psnProgram\anaconda\lib\site-packages\pybtex\database\input\__init__.py", line 56, in parse_file
raise PybtexError(six.text_type(e), filename=self.filename)
pybtex.exceptions.PybtexError: 'gbk' codec can't decode byte 0xb3 in position 25183: illegal multibyte sequence
I have changed data = bibtex.Parser().parse_file(infile)
to data = bibtex.Parser('utf-8').parse_file(infile)
, but still dont work.
I would need a minimal bibtex file to reproduce the issue.
same as questions like this refs_better.bib.txt
can't upload bib files.
I would need a minimal bibtex file to reproduce the issue.
I would need a minimal bibtex file to reproduce the issue.
oh, it did work when I apply the betterbib
to other bibliographies.
The original issue is fixed now. If you have anymore problem, open a new report.
On Windows the following error occurs, (see here):
It can be fixed by specifying the encoding while using
open()
(see here.Full log: