« prev next »

MovableType Dirify Change for UTF-8

Related Categories
  Blogging
  Friends
  Life
  Me
  Misc
  This Site
  Wendy
  Yifan
  Backstage
  Blog Tips
  Hosting
  Map
  MovableType
  Other Sites
  Spam
  Webcam

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.

Posted by Jian Shuo Wang at December 23, 2007 9:46 PM
Copyright: You are free to redistribute this work, as long as you keep this disclaimer and this link: http://home.wangjianshuo.com/archives/20071223_movabletype_dirify_change_for_utf8.htm

Related Entries: MovableType
  1. Subscription Enabled on This Blog April 23, 2008
  2. MovableType Dirify Change for UTF-8 December 23, 2007
  3. MovableType 4.01 and Bluehost CPU Exceeded Error November 16, 2007
  4. Wangjianshuo's Blog Template Archives 2007 November 5, 2007
  5. FeedBurner is a Useful Service August 28, 2007
  6. Upgraded to Movable Type 4 August 18, 2007
  7. MovableType 4 Finally Out August 15, 2007
  8. MovableType 4 is Almost Out August 14, 2007
  9. MTSubCategory of MovableType July 31, 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 - 2008 Jian Shuo Wang. All right reserved.