Re: mcedit



On Wed, Mar 10, 2010 at 2:41 PM, Yury V. Zaytsev <yury shurup com> wrote:
^M are not the embedded control characters.

Yes, they are. All characters under hexadecimal 0x20 are control characters.

This particular one (0x0D) is defined to cause the cursor to move to
the left edge. 0x0A is defined as move to the next line. Together,
they form the pair of controls that would cause a teletype (or a
terminal) to properly begin at the next line.

Every byte code from 0x00 to 0x1F is defined as a control character.
There is a BEL that is actually supposed to ring a bell, a backspace
(BS)  that moves the cursor backwards on the line, and a bunch more.
It's all part of ASCII, which defines the first 128 codes, 0x00 to
0x7F. You can learn more about ASCII here:

http://www.asciitable.com/
http://en.wikipedia.org/wiki/ASCII

Under many circumstances, it is entirely possible to open a file and
find control characters embedded in it, and need to edit them out (or
in, for that matter.) As it stands, removal can be done with the
delete key, but in no other way that I have found WITHIN mcedit.

It's just the way mcedit represents \r's (carriage return character).

...which is a control character. :) As the control characters are
generally produced on a keyboard by pressing control and the letters
A...Z, [,  \, ], ^, and _, they are often represented by ^A...^Z, ^[,
^\, ^], ^^, and ^_ when shown as embedded entities. Technically, 0x40
is being subtracted (or XOR'd, or nanded out) from the ASCII code of
the capital letter; so M, which is 0x4D, turns into 0x0D, represented
as ^M.

"\r" is yet another way, a considerably less sensible one in my
opinion, to represent the control character carriage return.
Thankfully, it isn't the one mcedit uses in the body of the text.

So if you run dos2unix on the file

Which requires RE-WRITING the file or creating a new output file, so
is no good...

or search and replace \r's (ASCII 13) with "" it should do the trick.

Ah. But that doesn't work. I can type \r into the search field until
I'm blue in the face in either F7 or F4, and mcedit does not find the
0x0D.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]