Bembel-B Blog

2005/12/29

Display DOS ASCII Arts (e.g. NFO Files) on Linux

Filed under: ASCII,ASCII Arts,codepages,DIZ,iconv,Linux,NFO,software,UTF-8 — FrankZabbath @ 19:14

In order to properly display NFO files, their content has to be converted to your local codepage.
In my case that is UTF-8. The conversion will be done with iconv. To get the solid block characters I chose the input codepage IBM 437. some ascii arts snippet from xterm
So the resulting command is:

iconv -f 437 -t UTF8 dafile.nfo | less

For a list of available formats type:

iconv --list

It is handy to have this command as a script. That would be something like this:

#!/bin/bash
# Display DOS ASCII Arts (e.g. NFO Files)

if [ -z "$@" ]
then
  echo "No filename given."
  echo "Usage: `basename $0` filename(s) [filename(s)]..."
else
  iconv -f 437 -t UTF8 "$@" | less
fi

exit 0

You can download this script from my Box.net share.

Click on the screenshot to view a larger version.

ChangeLog

[2006-04-23: Add tags.]
[2007-05-23: Download link.]

Create a free website or blog at WordPress.com.