Archive for September, 2006

Sidenote

Wednesday, September 27th, 2006

Alt wie ein Baum möchte ich werden, genau wie der Dichter es beschreibt.

You may leave a blog post after the beep.

Wednesday, September 27th, 2006

K. is on holiday. And he has left his mobile phone at home. For the next 7 days I can only reach him through a blog. Although I’m not entirely sure if this includes my blog, I just try.

In -1 Tagen geht`s ab nach Rom!

Happy holidays!

Yellow Bills

Friday, September 22nd, 2006

Björn reports, that he just got a delivery report with the words Gelbe Karte!!! (yellow card) printed below the list of the delivered items. Although it was just an internal note for a new colleague, Björn – like many other customers of the company – thought that he somehow missed to pay the bill in time.

I should cosider printing those words under my bills, too.

Is Internet Explorer compatible to Mozilla?

Thursday, September 21st, 2006

The answer is: It claims to be, but it proably isn’t.

If you surf to this site with Internet Explorer (the user experience may not be so good as the layout of this site is fairly broken in Microsofts flagship browser), your browser will identify itsself with our server sending a special token called user agent string.

For the new Internet Explorer 7.0 on the new Windows Vista, this token looks like this:

  1. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)

In its MSDN library article Understanding User-Agent Strings Microsoft writes:

For historical reasons, Internet Explorer identifies itself as a Mozilla 4.0 browser.

and

The Compatibility flag (“compatible”) is used by most modern browsers; it indicates that Internet Explorer is compatible with a common set of features.

This is of course right. However, they could have provided a bit more information.

If the part Mozilla/4.0 reminds you of Internet Explorers rival Mozilla Firefox (highly recommended), this is not without cause. Back in the early days, when the Netscape browser still dominated the internet, Mozilla was the code name of Netscapes core rendering engine used to display the web pages on your screen. When Netscape open sourced their code in 1998, they named the new open source project after the code name of their rendering engine. The project was called Mozilla.org. And this is also the home of the now famous Firefox browser.

Because of the so-called browser sniffing, Internet Explorer was one of the first browsers to implement user agent spoofing. Wikipedia gives us all the information about the origin of the word Mozilla in Internet Explorers user agent string:

The earliest example of this is Internet Explorer’s use of a User-Agent string beginning “Mozilla/ (compatible; MSIE …”, in order to receive content intended for Netscape Navigator, its main rival at the time of its development. It should be stressed that this is not a reference to the open-source Mozilla browser, which was developed much later, but to the original codename for Navigator, which was also the name of the Netscape company mascot. This format of User-Agent string has since been copied by other user agents, partly because Explorer, in turn, came to dominate.

This means Internet Explorer 7.0 identifies itsself as Mozilla/4.0, which refers to the rendering engine of Netscape 4. The detailed information (in parenthesis) contains the string compatible. This means Internet Explorer 7.0 claims to be compatible with the rendering engine of Netscape 4 and it also shows to anyone, who’s interested, that the visiting browser is not actually Netscape 4, but just a compatible bowser. The compatible set of features Microsoft mentions in their article are that of Mozilla/4.0, the rendering engine of Netscape 4. The rest of the parenthesis part refers to the actual name and version of the browser and the operating system of the client computer.

For the record, this is the user agent string of Mozilla Firefox 1.5.7 on Debian Linux:

  1. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7

Of course we wouldn’t have expected from Microsoft to mention their old (and somehow new) rival in the browser market (Netscape and Mozilla) in one of their MSDN articles…

Switching To Unicode

Saturday, September 2nd, 2006

If you want to convert your web application to unicode, that is easier than you might think. Just follow these steps:

  1. Switch your character encoding to unicode. In Apache you can add the following line to your virtual host container or .htaccess file.

    1. AddDefaultCharset UTF-8
  2. If you specified another encoding in your HTML files or used something like the header method in PHP to force the server to send the pages with another encoding, you need to change those files, too.

  3. Backup your database. In MySQL you can do this by using mysqldump.

    1. mysqldump -u username -p database table > table-yyyymmdd.sql
  4. Convert the SQL dump to UTF-8 using something like iconv.
    Don’t overwrite your backup, but write the output of iconv to another file. This will save time if you need to go back to the old state or if something is messed up. Note: UTF-8 is not supported out of the box. See iconv -l for a list of supported encodings.

    1. iconv -f ISO-8859-1 -t UTF-8 table-yyyymmdd.sql > table-yyyymmdd-utf8.sql
  5. Replace the character encoding information in the converted SQL data. Again: Don’t mess with your backup – use the right file.

    1. vi table-yyyymmdd-utf8.sql
    2. :%s/latin1_german2_ci/utf8_unicode_ci
    3. :%s/latin1/utf8
  6. Replace your data in the database with the converted data. In MySQL this is a fast one:

    1. mysql -u username -p database < table-yyyymmdd-utf8.sql
  7. Check that everything works.

Done.

Flash Player 9 on Linux

Friday, September 1st, 2006

Interview with Mike Melanson, lead engineer on the Linux Flash Player team [via Jeff Waugh (p.g.o)]

Getting Older

Friday, September 1st, 2006

Last night I switched through TV channels and saw Harald Schmidt in serveral of the third programmes. And I thought to myself: He looks old now. That’s live.

While we are discussing Harald: Do you know what’s interesting? All the third programmes reair his show. But not at the same time. There is a time gap of around 5-10 minutes in between. If you saw the show on one channel and liked it, you could zap back through all other thrid programms and you will find a third programme where it just starts. That way, you could view the show on ARD, switch to a third programme and see the show again and – if you really liked the show – switch to another third programme and watch it all over again. I guess some affectionate fans really do this…