Uni-no-code

Because my laptop is getting older my ethernet and wireless hardware has failed on me so I’m relagated to downloading the webpages I want to read at the library. I don’t complain, this actually works just fine for me. Firefox though cannot open multiple pages at once:

firefox *.htm

So I built a script that does so:

#!/bin/bash
# firefox to open all .htm, .html files

for X in *.htm
do
    firefox "$X"
done

for Y in *.html
do
    firefox "$Y"
done

Only problem is, XP doesn’t write unicode so Firefox will complain that it can’t find the file when it encounters a character it doesn’t understand. Unknown characters in Unicode will map as “�”. This may not translate well on WordPress, or the Browser, or the OS you’re using so here’s a pic:

XP Uni-no-code

For any developers out there, do you have an idea how to write a script to rewrite the filenames so they are Unicode (or remove the un-unicode lettering) without having to manually type in each name?

2 Comments »

  1. numerodix said

    There is a utility to convert files between encodings. It’s called iconv. So for instance:
    iconv -f utf-8 -t iso8859-1 -o newfilename filename

  2. Thanks numerodix, I’ll give this a try.

RSS feed for comments on this post · TrackBack URI

Leave a Comment