2 Comments

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?

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

2 comments on “Uni-no-code

  1. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: