« prev next »

MovableType Dirify Change for UTF-8

This is for MovableType 3.2, but the same for 3.3, or 4.0, 4.01.

In the file /mt/lib/MT/Util.pm, there are two lines. I have to change it from:

LINE 553: sub dirify {
LINE 554: ($MT::VERSION && MT->instance->{cfg}->PublishCharset =~ m/utf-?8/i)
LINE 555: ? utf8_dirify(@_) : iso_dirify(@_);
LINE 556: }

It has to be changed to
LINE 553: sub dirify {
LINE 554: # ($MT::VERSION && MT->instance->{cfg}->PublishCharset =~ m/utf-?8/i)
LINE 555: iso_dirify(@_); # ? utf8_dirify(@_) : iso_dirify(@_);
LINE 556: }

I made all the changes to my installation base of MoableType.

The reason is, I have all the titles dirified to become the URL. In Chinese names, the newer version (which actually fixed a bug) simply turns all UTF-8 (Chinese title) into nothing, which is not friendly for users.

After the change, the entry titled "Wendy说过一句话" will be in URL: http://home.wangjianshuo.com/cn/20071121_wendyeeaee.htm

Although the Chinese part was lost, at least it is some way of distinguishing different entries, and this encoding does not change along with the database. It does not has any type of IDs in it. Imagine if you have entry_id in the URL, and you do an export and import - all the URL changes.

Cool URIs don't change. This is also what I believe.

by Jian Shuo Wang on December 23, 2007 under MovableType

Related Entries: MovableType
  1. Google Reader Support PubSubHubbub February 22, 2010
  2. Enabled PubSubHubbub on my Blog February 17, 2010
  3. Six Apart's Problem? February 22, 2009
  4. Track Click on Elements February 22, 2009
  5. Short Pause of Comment System January 20, 2009
  6. MovableType 4.2 is Disappointing June 8, 2008
  7. Subscription Enabled on This Blog April 23, 2008
  8. MovableType Dirify Change for UTF-8 December 23, 2007
  9. MovableType 4.01 and Bluehost CPU Exceeded Error November 16, 2007
Comments
Post a comment
Name:

Email Address: (will not show)

URL: (optional)

Comments:


It may take up to 30 seconds before the server returns a result. IP address recorded.
Remember my information?
<-- Please click POST only once
© 2001 - 2009 Jian Shuo Wang. All right reserved.