Skip to content
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

Unexpected character '\0' at line 19 column 2 #6

Closed
louis-etne opened this issue Apr 25, 2017 · 4 comments · Fixed by #8
Closed

Unexpected character '\0' at line 19 column 2 #6

louis-etne opened this issue Apr 25, 2017 · 4 comments · Fixed by #8
Labels

Comments

@louis-etne
Copy link

I'm trying to parse a bibtex using your library, but I'm getting the following error :

Unexpected character '\0' at line 19 column 2

Any way to support the null character ?
Thanks 😄

@renanbr
Copy link
Owner

renanbr commented Apr 25, 2017

Any way to support the null character ?

I don't know what the '\0' character means in the latex world, but I think we could support it 👍

Could you share the entry you are trying to parse?

@louis-etne
Copy link
Author

louis-etne commented Apr 25, 2017

Yes ! The bibtex is available at this address. (button export at the top)

@renanbr
Copy link
Owner

renanbr commented Apr 25, 2017

I should review my internet skills 😅 I can't find the export button, maybe because i'm not logged in, I've found just a link to export to the .ris format

@Boopr is there other way I can download it or could you send it to my inbox?

@renanbr
Copy link
Owner

renanbr commented Apr 25, 2017

Thanks for sharing the file.

The error is caused because when the parser finds a % character inside a delimited-value section, he thinks that a comment section is starting. This causes that all characters after the % are ignored, including the quote that closes the delimited-value section, which causes a unexpected end of file. The message error is not very clear, I agree.

I won't have time to get down on this issue soon, but I've opened a branch.

Some notes:

  • In latex the % char should be escaped as \%, but It makes sense not to do it in a bibtex file
  • The §4, item 14, p. 14 of official documentation says : "LATEX's comment character '%' is not a comment character in the database files."
    • It means this library does not work strictly
    • I'm not sure whether we should keep the % as comment character in the stable version or not (some libraries do the same)
  • The error in travis for PHP 7 is not related to the fix

This was referenced May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants