New MT 3.16 dirify bug: works with utf-8 but not with UTF-8

There was a bug in the dirify function in Movable Type which didn't know how to convert URLs from content encoded in Unicode. It hit me when I moved this blog from ISO-8859-1 to UTF-8 last year. At that time I hacked the MT code to fix this bug in such a way that an upgrade with a bug fix would work without further ado. So I was surprised, after upgrading to MT3.16 which was supposed to fix this bug, to see it coming back!

A quick look at /lib/MT/Util.pm shows this code for the dirify function in MT 3.16:

sub dirify {
($MT::VERSION && MT->instance->{cfg}->PublishCharset eq 'utf-8')
? utf8_dirify(@_) : iso_dirify(@_);
}

So obviously the test is case-sensitive. My config file had this line:

PublishCharset UTF-8

Bummer! Changing it to lowercase fixed the problem:

PublishCharset utf-8

I've filed a bug report at Six Apart. IMO all charset tests should be case insensitive.

Update: it's fixed in MT 3.17.

1 Comment

Hey François. I just ran across this post. Just so you know, in the next version, Movable Type accepts PublishCharset in a case-insensitive manner.

Sorry for the inconvenience and thanks for filing the bug.

mensuelles Archives

Recent Entries

  • Steve Jobs

    "Remembering that I’ll be dead soon is the most important tool I’ve ever encountered to help me make the big choices in life. Because...

  • Your privacy on MOTOBLUR by Motorola

    After the Nokia Ovi Store carelessness, it's now Motorola who's allowing strangers to get access to your private information on their MOTOBLUR portal. Exactly like...

  • How to resume a broken ADC download

    (I'm documenting this trick for myself to remember, but it can be useful for others…) Apple, on its Apple Developer Connection site, has a bad...

  • WTF is this ‘myEventWatcherDiv’ doing in my web?

    All of a sudden I started to find the following line in most of the web pages I was browsing, including ones I made where...

  • Your privacy on Nokia Ovi Store

    My friend Adam Greenfield recently complained about the over-engineering culture at Nokia: I was given an NFC phone, and told to tap it against the...