Is there a binary editor for MacPorts?

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Wed Sep 22 22:33:04 UTC 2021


I don't know about true binary editors.  However it seems like you might be
trying to bridge older vs. newer character sets, like me.  For this I have
found the following approaches to be better than your "vi" experience.  If
your purpose is more general than character set translation, then someone
else may have a better suggestion.

* Open the file with the TextEdit app, which I believe is a built-in MacOS
application.  This will make a reasonable effort to open and display any
kind of file, including true binary files never intended for direct
viewing.  ASCII, UTF-8, and many other character sets will be detected and
displayed properly.  If you want to override the automatic character set
guessing, go to Options in the File/Open dialog.  Overtyping can be done
manually, if the number of substitutions is small.

* Use iconv on the command line to translate to a different character set.
This is also included with MacOS.  Man iconv for more details.  Caveat,
this program will stop on the first unrecognized sequence, unless one of
the substitution options is used.  For example, translate UTF-8 to
ISO-8859-1, and insert legible escape sequences for all unrecognized
sequences:

    iconv -f UTF-8 -t ISO-8859-1 --unicode-subst="<U+%04X>" infile > outfile

* To simply display binary, not edit, use "od -Ad -c" or "od -Ad -tx1" on
the command line.


On Wed, Sep 22, 2021 at 3:27 PM Dave Horsfall <dave at horsfall.org> wrote:

> I can see heaps of 3rd-party stuff out there, but is there an "official"
> one?
>
> I have a file with some binary stuff in it (8-bit accents, perhaps?) and
> "vi" just spits the dummy at that point and I want to search down further.
>
> Thanks.
>
> -- Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20210922/15e64000/attachment.htm>


More information about the macports-users mailing list