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

Problem with opening a faulty file #1708

Closed
Kzer-Za opened this issue Dec 4, 2017 · 3 comments
Closed

Problem with opening a faulty file #1708

Kzer-Za opened this issue Dec 4, 2017 · 3 comments
Labels

Comments

@Kzer-Za
Copy link

Kzer-Za commented Dec 4, 2017

It can't be called problem that is totally on the Geany side, because something is definitely wrong with the file, but still, less and cat can read it and micro can read and edit it. Geany at first can't open the file at all.

One of the things that are wrong is that the file does not end with a newline, but usually that is not a problem for Geany, something else is the matter, but I don't know what. When I add a newline in the end with micro, Geany is able to open the file but the contents are mojibake (actually it should be ASCII). If I then use File -> Reload as, and choose UTF-8 or Without encoding, Geany displays the content correctly, but only down to the 909th line, then the file is cut off, while actually it consists of 1264 lines + the end newline.

Haldar's Mods Pack.txt

@elextr
Copy link
Member

elextr commented Dec 4, 2017

Less and cat just copy bytes, they are encoding agnostic.

Does not open in xed either.

UTF-8 or Without encoding, Geany displays the content correctly, but only down to the 909th line, then the file is cut off,

Then there is probably a zero byte at the 909th line. Probably it has mixed encodings. Try looking at the file with a hex decoder.

@b4n
Copy link
Member

b4n commented Dec 4, 2017

Looks like your file has a NUL byte at the 910th line (after the a). Geany currently does not support NUL bytes in files, so it causes some issues, like cutting the file after the first NUL byte, and preventing automatically loading it successfully. See @elextr's answer and #618 (comment)

@Kzer-Za
Copy link
Author

Kzer-Za commented Dec 4, 2017

@elextr, @b4n - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants