question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Will not open file (Charset Exception when reading file)

See original GitHub issue

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

jabref 5.6 or 5.7 on WIndows 10

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

I moved a bib file to a new location and suddenly the file will not load. I will attach the log file - it’s some java error that I cannot decipher. I opened the bib file in emacs, and had emacs check the syntax, and it passed the test. I beautified the file in emacs and jabref still will not load the file.

If I remove two-thirds of the file, jabref will load the file. I thought there might be a malformed entry. By trial and error, I determined the exact stopping point. However, when I remove that entry, jabref still fails.

The problem arose with jabref 5.6. I installed jabref 5.7 and the same problem arose.

jabref opens another file without a problem.

Appendix

Paste an excerpt of your log file here

Error opening file 'C:\Users\singer.2\OneDrive - The Ohio State University\Documents\Projects\TauFibrils\Notes\Bibliography\PeptideFibrils1.bib'
java.nio.charset.MalformedInputException: Input length = 1
	at java.base/java.nio.charset.CoderResult.throwException(Unknown Source)
	at java.base/sun.nio.cs.StreamDecoder.implRead(Unknown Source)
	at java.base/sun.nio.cs.StreamDecoder.read(Unknown Source)
	at java.base/java.io.InputStreamReader.read(Unknown Source)
	at java.base/java.io.BufferedReader.fill(Unknown Source)
	at java.base/java.io.BufferedReader.read(Unknown Source)
	at java.base/java.io.FilterReader.read(Unknown Source)
	at java.base/java.io.PushbackReader.read(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.fileformat.BibtexParser.read(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.fileformat.BibtexParser.skipWhitespace(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.fileformat.BibtexParser.parseFileContent(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.fileformat.BibtexParser.parse(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.7.86/org.jabref.logic.importer.OpenDatabase.loadDatabase(Unknown Source)
	at org.jabref@5.7.86/org.jabref.cli.ArgumentProcessor.importAndOpenFiles(Unknown Source)
	at org.jabref@5.7.86/org.jabref.cli.ArgumentProcessor.processArguments(Unknown Source)
	at org.jabref@5.7.86/org.jabref.cli.ArgumentProcessor.<init>(Unknown Source)
	at org.jabref@5.7.86/org.jabref.gui.JabRefMain.start(Unknown Source)
	at org.jabref.merged.module@5.7.86/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
	at org.jabref.merged.module@5.7.86/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source)
	at org.jabref.merged.module@5.7.86/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.jabref.merged.module@5.7.86/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
	at org.jabref.merged.module@5.7.86/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at org.jabref.merged.module@5.7.86/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at org.jabref.merged.module@5.7.86/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)


Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
CodeSJScommented, Jun 1, 2022

I will make the subject line attn ThiloteE

0reactions
CodeSJScommented, Oct 11, 2022

5.3 opens the old file successfully! 5.6 and 5.7 do not.

The old version last saw emacs several years ago, before I saw the light and switched to jabref. It had been saved by jabref many times.

The only time I saved the file from emacs using undecided-unix was the other day, (wrongly) thinking that would take care of character set issues. Now I know to save using utf-8.

Thanks for your help, Sherwin

From: ThiloteE @.> Sent: Tuesday, May 31, 2022 7:29 AM To: JabRef/jabref @.> Cc: Singer, Sherwin @.>; Author @.> Subject: Re: [JabRef/jabref] Will not open file (Charset Exception when reading file) (Issue #8870)

This problem goes both ways: Emacs could have changed their “undecided unix” export. What happens if you import or open the non-working file with older versions of JabRef? — Reply to this email directly, view it on GitHub, or ‍ ‍ ‍ ‍ ‍ ‍ ‍

This problem goes both ways: Emacs could have changed their “undecided unix” export. What happens if you import or open the non-working file with older versions of JabRef?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/JabRef/jabref/issues/8870*issuecomment-1142011129__;Iw!!KGKeukY!xHet1mEzjsRKLUyE2nxsUm-CmvrHI4qHiEpqV-KMbjF3ae7nt5QepuSFz1_hcO655kYiwGJXkoWYslyNR0dqFuNqEH1Gw9sHJfnI$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AJII6NCAO2PSROYB25ERWR3VMXZY7ANCNFSM5XLL5PBA__;!!KGKeukY!xHet1mEzjsRKLUyE2nxsUm-CmvrHI4qHiEpqV-KMbjF3ae7nt5QepuSFz1_hcO655kYiwGJXkoWYslyNR0dqFuNqEH1Gw0UWt8rK$. You are receiving this because you authored the thread.Message ID: @.@.>>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opening a text file, and receiving a encoding error, tried ...
Try reading with f.read() or f.readlines() . You are actually trying to get elements from file instance not from data inside the instance....
Read more >
How to read a UTF-8 file in Java - Mkyong.com
We can pass a StandardCharsets.UTF_8 into the InputStreamReader constructor to read data from a UTF-8 file. import java.nio.charset.
Read more >
Files (Java SE 13 & JDK 13 ) - Oracle Help Center
Opens a file, returning an input stream to read from the file. The stream will not be buffered, and is not required to...
Read more >
Python 3 Notes: Reading and Writing Methods
After the file content is read in, .close() is called on myfile, closing the file ... Reading a UTF-8 file; 'r' is omitted...
Read more >
Specify text encoding when reading files - Code Review Doctor
Not specifying encoding when reading a file can cause UnicodeDecodeError because Python assumes the file is encoded with the OS's default text encoding, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found