Stream read error opening UTF-8 file

lieszkol's profile image lieszkol posted 4 years ago in General Permalink

Hi Ansgar,

Having the following reproducible issue.

SQL file saved in MS Visual Studio with format "Unicode (UTF-8 Without Signature)".

Empty file, or just a few characters, doesn't seem to matter.

If I then try to open in Heidi (selecting the "UTF-8" encoding), I get an error: Stream Read Error. Heidi fails to load the file but from then on Heidi holds a lock on it. I can't edit it in any other application either. After killing Heidi the file is unlocked.

I turned on debug logging but there is nothing in the log:

"/ 2021-04-30 13:11:59 [] / / Loading file "P:\xxx.sql" (2 B) into query tab #1 ... /

I am attaching the file.

If I try to load the file with autodetect then I get this:

Description

The issue does not arise if the file is saved in format "UTF-8 with Signature" in Visual Studio (or Notepad++).

The issue is especially frustrating because if a dev saves a file in UTF-8 without signature and I try to open it, I have to restart Heidi to regain access to the file.

Thank you for your work on Heidi!

1 attachment(s):
ansgar's profile image ansgar posted 4 years ago Permalink

The attached file seems broken, it just contains the 2 characters "xF". Probably that's an issue in my upload logic, not sure. Could you upload it somewhere else?

lieszkol's profile image lieszkol posted 4 years ago Permalink

Yes the attached file only contained those two characters.

Hmm, that is interesting. If I add more characters to a file then the issue doesn't arise.

However, often I create a file in Visual Studio (which adds it to source control), and then open it in Heidi to write the actual SQL. So I guess the point is Heidi shouldn't break on opening an empty file, or a file with some dummy characters.

Thanks!

Please login to leave a reply, or register at first.