gedit can't open a txt file

Bug #1067915 reported by Simplehuman on 2012-10-17
This bug affects 12 people
Affects Status Importance Assigned to Milestone
gedit (Ubuntu)

Bug Description

I have a txt file with a list of pages of different sites (related to my work). It is generated by Firefox plugin "Webmaster Sape".
When I try to open it with gedit I see an error message: "Unknown error: Invalid byte sequence in conversion input".

But for ex. Geany and LibreOffice Writer open it without any problems.

File is attached.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: gedit 3.6.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.6.1-0ubuntu3
Architecture: amd64
Date: Thu Oct 18 00:40:24 2012
ExecutablePath: /usr/bin/gedit
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Beta amd64 (20121006)
 PATH=(custom, no user)
SourcePackage: gedit
UpgradeStatus: No upgrade log present (probably fresh install)

Simplehuman (simplehuman) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gedit (Ubuntu):
status: New → Confirmed
Matt White (mfwhite5) wrote :

Just upgraded to Quantal a week ago. Used gedit to edit a text file this morning and it worked fine. Restarted my computer and then tried to edit the same file again and got "Unexpected error: Invalid byte sequence in conversion input."

There shouldn't be any strange characters in the file.

Matt White (mfwhite5) wrote :

Bizarre workaround for this bug: cat the file from the command line and then copy and paste it back into a new text file in gedit. I had to copy-paste-save it in sections, because if I pasted the entire document into gedit all at once, the invalid byte sequence error remained.

Matt White (mfwhite5) wrote :

I am continuing to get this error on files that used to be able to be opened by gEdit. Here's an error message that is logged relating to this:

** (gedit:13182): WARNING **: Hit unhandled case 1 (Invalid byte sequence in conversion input) in parse_error.

Chriki™ (chrikitm) wrote :

I’ve been facing a similar issue. For me the problem was that the encoding of the file had changed since it was last opened with Gedit (from WINDOWS-1252 to UTF-8). As I had manually set the encoding when first opening the file, Gedit had saved this information and tried to reuse it the next time I opened the file after the encoding change; this resulted in said error message.

To fix the problem, I had to remove the saved encoding information from the gvfs metadata like so:

    gvfs-set-attribute --type unset MY_FILE.txt 'metadata::gedit-encoding'

I have posted more information on this at <>.

Simplehuman (simplehuman) wrote :

It is still actual, any attention to this bug?

Changed in gedit (Ubuntu):
status: Confirmed → Fix Released
status: Fix Released → Confirmed
Dmitry Shachnev (mitya57) wrote :

What you attached is not a .txt file, but rather a .tar.gz archive containing a .txt file. After unpacking it Gedit opens it fine:

zcat wmsape-list.txt.tar.gz > wmsape-list.txt.tar
tar xf wmsape-list.txt.tar
gedit wmsape-list.txt

Sebastien Bacher (seb128) wrote :

the txt is not a text, it's a compress archive rather, that's not a bug

Changed in gedit (Ubuntu):
importance: Undecided → Low
status: Confirmed → Invalid
Simplehuman (simplehuman) wrote :

Yes, it is .tar.gz archive with a .txt file, wich is NOT opening with gEdit, but is opening normally wil another text redactors (Geany, Writer, etc.)
So the bug is not invalid

Changed in gedit (Ubuntu):
status: Invalid → Confirmed
Simplehuman (simplehuman) wrote :

I'm attaching this txt file without compression...

Sebastien Bacher (seb128) wrote :

sorry, I misunderstood the previous comment, that's a duplicate of bug #575500 then

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions