-
Notifications
You must be signed in to change notification settings - Fork 134
Added option to select encoding of .bib file in parse_file() #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| @ARTICLE{¿Èö2013, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this file into a (new) |
||
| author = {¿Èö}, | ||
| title = {Test Title}, | ||
| year = {2013}, | ||
| journal = {²âÊÔÆÚ¿¯} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| """Testing the parse_file function.""" | ||
|
||
|
|
||
| import pytest | ||
|
|
||
| from bibtexparser import parse_file, writer | ||
|
|
||
|
|
||
| def test_gbk(): | ||
| library = parse_file("tests/gbk_test.bib", encoding="gbk") | ||
| lines = writer.write(library).splitlines() | ||
|
||
| assert len(lines) == 6 | ||
| assert lines[0] == "@article{凯撒2013," | ||
| assert lines[1] == "\tauthor = 凯撒," | ||
| assert lines[2] == "\ttitle = Test Title," | ||
| assert lines[3] == "\tyear = 2013," | ||
| assert lines[4] == "\tjournal = 测试期刊" | ||
| assert lines[5] == "}" | ||
Uh oh!
There was an error while loading. Please reload this page.