LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2015, 05:45 PM   #1
AlexBB
Member
 
Registered: Mar 2014
Posts: 435

Rep: Reputation: Disabled
garbage characters appear in gedit.


Hi there. My environment: Ubuntu 12.04, preferred editor is gedit. All of a sudden, just today I realized that I have close to 200 lines of chinese characters intemingled with small squares and circles instead of my gfortran code when I open this file in gedit. It has about 900 lines. I also see a red band on top of the editor window saying there are bad characters and if I want to quit or keep editing.

I then open the same file in vim and find that the file is intact, no errant characters at the bottom. I then uninstall gedit, reinstall it and find the same. The bottom of the file's filled with this chinese garbage. Any idea how to correct it?

Thanks, - A.

P.S. Just an example:

爀攀挀甀爀开氀攀昀琀圀开䄀䰀倀 㴀 爀攀猀㌀   ഀ਀℀ 䐀䔀䈀唀䜀㨀 戀攀昀漀爀攀 渀漀爀洀愀氀椀稀愀琀椀漀渀⸀ 吀栀攀 爀攀猀甀氀琀 椀猀 瀀爀椀渀琀攀搀 漀甀琀 昀漀爀 挀漀渀琀爀漀氀㨀ഀ਀℀         眀爀椀琀攀 ⠀⨀Ⰰ⨀⤀ ∀爀攀挀甀爀开氀攀昀琀圀开䄀䰀倀开䘀爀䰀漀眀开唀Ⰰ 戀攀昀漀爀攀 一漀爀洀愀氀椀稀愀琀椀漀渀㨀 ∀Ⰰ 爀攀猀㌀ഀ਀℀ 䄀氀氀 爀攀挀甀爀猀椀漀渀 

Last edited by AlexBB; 01-19-2015 at 07:51 PM.
 
Old 01-20-2015, 04:20 AM   #2
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Is it possible that you have gedit set to unicode 8bit instead of 16bit? (or the other way round?)

Hmmm. When I copy/paste that example to a text file and do a hex dump, I see that every third byte is x80 (128 in decimal)


First, check the file encoding settings in gedit preferences and see if changing these makes any difference. If that doesn't seem to help, report back to this thread and attach one of the files that is not been rendered correctly. That we we can see if we can reproduce this.
 
Old 01-20-2015, 06:18 AM   #3
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by AlexBB View Post
Hi there. My environment: Ubuntu 12.04, preferred editor is gedit. All of a sudden, just today I realized that I have close to 200 lines of chinese characters intemingled with small squares and circles instead of my gfortran code when I open this file in gedit. It has about 900 lines. I also see a red band on top of the editor window saying there are bad characters and if I want to quit or keep editing.
by "gfortran code", you're referring to source code, are you? That would mean plain ASCII for the most part.
What character encoding are you actually using with this file?

Quote:
Originally Posted by AlexBB View Post
I then open the same file in vim and find that the file is intact, no errant characters at the bottom. I then uninstall gedit, reinstall it and find the same. The bottom of the file's filled with this chinese garbage. Any idea how to correct it?
Is it possible that -for whatever reason- there's some binary garbage appended to the text file, and vim is clever enough to ignore this? It's not like I've got an explanation, just wondering ...

[X] Doc CPU
 
Old 01-20-2015, 09:51 AM   #4
AlexBB
Member
 
Registered: Mar 2014
Posts: 435

Original Poster
Rep: Reputation: Disabled
Thank you guys. I am currently away from my computer (at work) and will be able to answer your questions in about 10-12 hours, however I do remember certain things. Yes, the encoding is 8 bit, I remember it clearly. Also I googled yesterday and found out that someone ran into a similar problem in Ubuntu 7 (?). Also this site says gedit cannot detect character encoding.

Yes, I meant the gfortran source code. Also check this. The gedit problem has been known for years. I wonder why it began only yesterday after months of my using gedit?

Also this.

Last edited by AlexBB; 01-20-2015 at 11:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VIM, NANO, Gedit, CAT display VISUDO as garbage xtropx Linux - Newbie 7 04-30-2012 02:18 PM
xterm garbage characters MTK358 Linux - Software 13 09-29-2009 09:02 AM
garbage characters when switched to text mode allasso Linux - Software 0 01-24-2005 04:46 PM
Video garbage characters on RH9 boot kpenrod Linux - Hardware 5 10-26-2003 03:49 PM
Printer Paper-out Problem - Garbage Characters esage Mandriva 7 09-19-2003 07:21 PM


All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration