when I migrate .htm files done with gedit from one system to another, I'm told that it's a binary file and the other options for character sets don't solve the problem

Asked by Bruce Mincks

I backup my files with a cp-rup command on a box computer, edit the file on a laptop, and go back and forth depending on where I want to work. Sometimes the copying hangs up for unknown reasons, but this problem often results. The permissions seem the same. I don't rally know the category of this problem.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Solved by:
Enrico Rosina
Solved:
Last query:
Last reply:
Revision history for this message
Enrico Rosina (e-rosina) said :
#1

Hello,

I don't know about gedit to create XML files, I'm surprised that someone does it.

I said that because the first thing coming to my mind when I see "I'm told that it's a binary file",
is that maybe your tool inserts a BOM at the beginning of the file?
(see http://en.wikipedia.org/wiki/Byte_order_mark)

Normally if you use gedit as plain text there is no automatic BOM inserted, but... maybe you
could check it. I don't know if there is an option to display the BOM with gedit, maybe it's a
hidden character. Also what encoding are you using? If you don't use UTF-8 but
ISO-8859-1 or CP1252, then maybe your file will be prepared "as if" it was aimed to a Windows
operating system, which likes to have such marks?

Please allow me a side-question, having less to do with your question:
Do you have some add-on into gedit to do so? Is there some reason not to use an IDE
which will check your XML syntax for you, and also do plenty of things like decorating
tags with colors or formatting the content?

Regards
Enrico

Revision history for this message
Enrico Rosina (e-rosina) said :
#2

Oops, so sorry. I read your question again and I don't fell well now...
I cannot understand how I read "XML" in your question. Also sorry that
I cannot erase my previous answer...
Hope you find a better help with somebody else!
Enrico

Revision history for this message
Bruce Mincks (bmincks) said :
#3

Thanks. I find creating html much easier and flexible in gedit. It color
codes the syntax, in fact, and since I don't have any use for the
extensions in XML, I'd much rather learn to code the tags directly than
deal with another interface and wonder about the object's format. It also
keeps the files smaller as it doesn't declare every option before I specify
any choice.

I don't know what a BOM is meanwhile, nor can I find any place on my system
menus for declaring the character sets. I only know that English (United
States) was declared when I installed the O/S, but there's nothing to
reflect the encoding either in the gedit preferences or the Linux
Adminstration menu, so far as I can tell. I changed the gedit font
(Monospace) to make it display bigger.

I found that the executable box was checked on the folder containing all
these files on my laptop, so perhaps the problem will resolve itself. This
problem happened repeatedly but not consistently.

Thanks for responding.

On Mon, Aug 20, 2012 at 11:15 AM, Enrico Rosina <
<email address hidden>> wrote:

> Your question #206340 on gedit in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gedit/+question/206340
>
> Enrico Rosina posted a new comment:
> Oops, so sorry. I read your question again and I don't fell well now...
> I cannot understand how I read "XML" in your question. Also sorry that
> I cannot erase my previous answer...
> Hope you find a better help with somebody else!
> Enrico
>
> --
> You received this question notification because you asked the question.
>

--
Bruce Mincks
3776 Alabama Street #C-206
San Diego, CA 92104

(619) 255-4262

cell: (619) 548-5336

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

What OS is the 'other system'?

Revision history for this message
Bruce Mincks (bmincks) said :
#5

They're both Linux, but the box has ubuntu and the laptop has debian.
There was never any Windows on the box, and Windows self-destroyed when I
installed Ubuntu on the laptop two years ago. Coincidentally, while I
can't find any menu that allows me to declare the character set in Debian
(not on the internet), I can change the "input method" through the
"language support" preference in Ubuntu, but those don't correspond with
the choices that don't work when gedit won't open these text files (named
with an .htm extension).

On Mon, Aug 20, 2012 at 12:55 PM, actionparsnip <
<email address hidden>> wrote:

> Your question #206340 on gedit in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gedit/+question/206340
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> What OS is the 'other system'?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+source/gedit/+question/206340
>
> You received this question notification because you asked the question.
>

--
Bruce Mincks
3776 Alabama Street #C-206
San Diego, CA 92104

(619) 255-4262

cell: (619) 548-5336

Revision history for this message
Best Enrico Rosina (e-rosina) said :
#6

Hello again,

I see that the post remains open, so I try another answer...

- Maybe deselecting the "executable" flag is not a bad idea, I think you did right. Did that not
  solve the problem?

- I think you can forget about the BOM. It's a hidden character placed at the very beginning
  of your source to declare the encoding type. But it is used with XML files, not HTML.

- If you want to try to change the encoding of a file with gedit, and see if it comes out better:
  When you select "file => save as", there you can select the new encoding of your file. The
  default encoding in Ubuntu is UTF-8, if you don't change it there should not be problems
  opening your file with debian. If you try to play with the encoding, keep an old version of
  your file, just in case, to be sure you come back...

- You say that you accidentally lost Windows when you installed Linux, did you let the
  installer select the default file system (for instance ext4), or did you keep some Windows
  partitions on your disk? Years ago, it was said that the handling of NTFS files with Linux
  might not be 100% secure. Now it should be ok, but if you want to ensure what type of
  partitions you have, you can type this in a terminal: sudo fdisk -l

- Just coming once again about an IDE, just because I am not sure that I explained well
  last time: I have NetBeans but it's not the only IDE existing. It lets you create your
  html, there is only plain text in it exactly like gedit (it's not a graphical builder). Just
  it makes validations for you. For instance it does not allow you to forget an end tag.
  If you write: <TABLE>, it will raise an error if you forget </TABLE>.
  There is also plenty of contextual help. For instance if you write: "<IMG", ctrl-space at
  this place displays you what options you can write next into the tag. And with
  a simple right click => format will realign prettily your source content. And finally, if
  you want a preview for testing your css, there is a plugin available, easy to install.
  The default is as you suggested: there is some learning to understand the IDE and it's
  not so quick to open as gedit. But it's such a comfort!

Hope you find a solution for your file source "binary" problem.
Enrico

Revision history for this message
Bruce Mincks (bmincks) said :
#7

Thanks Enrico Rosina, that solved my question.

Revision history for this message
Bruce Mincks (bmincks) said :
#8

I haven't experiences this problem since I deselected the executable flag,
so I guess the problem is solved.

Meanwhile, thanks for the helpful information about where the character set
was declared in the first place.

It's been about 18 months since I installed Ubuntu on this Toshiba laptop,
and I only remember that without selecting anything, it not only ruined
Windows but also didn't install Linux. I took it to a computer guy across
the street, who reformatted the disk and reinstalled Ubuntu. I probably
tried this installation with an older version of SUSE rather than off the
web, but I recall using a Windows98 O/S on an old PC many years ago without
having the serial number handy and Windows not only ruined the disk but
went into the BIOS to test my understanding there. I was once a great fan
of WordPerfect for paralegal word processing, to give you some idea of my
fondness for Windows.

It's the "open" alternative to Steve Jobs' "closed" designs, ac cording to
Jobs' biographer, by the way.

On Fri, Aug 24, 2012 at 1:45 PM, Enrico Rosina <
<email address hidden>> wrote:

> Your question #206340 on gedit in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gedit/+question/206340
>
> Status: Open => Answered
>
> Enrico Rosina proposed the following answer:
> Hello again,
>
> I see that the post remains open, so I try another answer...
>
> - Maybe deselecting the "executable" flag is not a bad idea, I think you
> did right. Did that not
> solve the problem?
>
> - I think you can forget about the BOM. It's a hidden character placed at
> the very beginning
> of your source to declare the encoding type. But it is used with XML
> files, not HTML.
>
> - If you want to try to change the encoding of a file with gedit, and see
> if it comes out better:
> When you select "file => save as", there you can select the new encoding
> of your file. The
> default encoding in Ubuntu is UTF-8, if you don't change it there should
> not be problems
> opening your file with debian. If you try to play with the encoding,
> keep an old version of
> your file, just in case, to be sure you come back...
>
> - You say that you accidentally lost Windows when you installed Linux, did
> you let the
> installer select the default file system (for instance ext4), or did you
> keep some Windows
> partitions on your disk? Years ago, it was said that the handling of
> NTFS files with Linux
> might not be 100% secure. Now it should be ok, but if you want to ensure
> what type of
> partitions you have, you can type this in a terminal: sudo fdisk -l
>
> - Just coming once again about an IDE, just because I am not sure that I
> explained well
> last time: I have NetBeans but it's not the only IDE existing. It lets
> you create your
> html, there is only plain text in it exactly like gedit (it's not a
> graphical builder). Just
> it makes validations for you. For instance it does not allow you to
> forget an end tag.
> If you write: <TABLE>, it will raise an error if you forget </TABLE>.
> There is also plenty of contextual help. For instance if you write:
> "<IMG", ctrl-space at
> this place displays you what options you can write next into the tag.
> And with
> a simple right click => format will realign prettily your source
> content. And finally, if
> you want a preview for testing your css, there is a plugin available,
> easy to install.
> The default is as you suggested: there is some learning to understand
> the IDE and it's
> not so quick to open as gedit. But it's such a comfort!
>
> Hope you find a solution for your file source "binary" problem.
> Enrico
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/gedit/+question/206340/+confirm?answer_id=5
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/gedit/+question/206340
>
> You received this question notification because you asked the question.
>

--
Bruce Mincks
3776 Alabama Street #C-206
San Diego, CA 92104

(619) 255-4262

cell: (619) 548-5336