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.

Leave a comment

Recent Entries

  • Push Table

    The Push Table is exactly what I need for my desk, I love the concept!...

  • Velib feminine and charming?

    It's not obvious why the attachment of baskets to bicycles should be gender-related, but in fact one observes that 100% of the bicycles with baskets...

  • How to force the update from .Mac to MobileMe

    If you're a .Mac subscriber and want to migrate to MobileMe but Apple Softare Update is not giving you any joy with the required update,...

  • Monoculture lameness

    Software compatibility problems marred the launch of the iPhone 3G at Apple's flagship store in London, where customers had difficulty activating their new phones. Apple...

  • Wikis the milky way

    Milk can help you learn things about wikis. But wikis can teach you things about milk too ;-). [Thanks to Martin for the link.]...