MT-Textile 2.0.2

Available here.

The weird problem that this update addresses is a glitch in a particular edition of Perl. Specifically 5.8.0 with the 18379 maintenance patch. For example, that version of Perl causes this to break:

use Encode;
my $str = 'a';
$str = Encode::decode('iso-8859-1', $str);
if ($str =~ m/^([^\s]*?)$/) {
  print "found $1\n";
} else {
  print "no match\n";
}

Under most versions of Perl (that have utf8 string support), this will print:

found a

But for Perl 5.8.0, with the 18379 maintenance patch, it prints:

no match

Very odd indeed. Thats a very basic regex failure for utf8 strings, don't you think?

In fact, you can eliminate the decode operation and produce the same failure by changing it to this:

Encode::_utf8_on($str);

Which just flips the little 'utf8' flag on $str. This should have no adverse effect to 7-bit ASCII data, but it does alter how that regex operation matches.

In any case, this particular issue has been a real annoyance. In MT-Textile, what I want to do is this:

  1. Take the raw byte data as provided by Movable Type
  2. Decode the data to native a Perl wide-character string (only if the user has Encode and if their PublishCharset is defined in mt.cfg)
  3. Do everything Textile would do (safely operating against multibyte characters)
  4. If step 2 happened, encode the data returned by Textile back to the character set identified by PublishCharset.
  5. Return string back to Movable Type

But with this bug, I've been forced to eliminate steps 2 and 4 which means that Textile may or may not properly handle multibyte data. That being said, I have not seen any problems with my (limited) tests with Japanese, Chinese, Korean, etc. But if you do, please report any problems you may encounter to the bugtracker.

TrackBack

TrackBack URL for this entry:
http://bradchoate.com/mt/feedback/tb/840

Listed below are links to weblogs that reference MT-Textile 2.0.2:

» MT-Textile 2.0.2 and Firefox MT Bookmarklets from ¤ Funtime Franky ¤
I’ve just updated to MT-Textile 2.0.2, which is a small bugfix for Brad’s excellent MT-Textile plugin for the MovableType blogging software. I’m also giving Firefox a good spin at the moment after writing an article. On the whole I... [Read More]

» MT-Textile 2.0.2 and Firefox MT Bookmarklets from ¤ Funtime Franky ¤
I’ve just updated to MT-Textile 2.0.2, which is a small bugfix for Brad’s excellent MT-Textile plugin for the MovableType blogging software. I’m also giving Firefox a good spin at the moment after writing an article a few days about h... [Read More]

» Day of the cool things from Surely you're joking, Mr. Larsen!
I discovered three truly cool things in a single day. Nice ☺ In no particular order: MT-Textile 2.0.2 (yes, I wasn't aware of it) Salling Clicker v.2.1 with Nokia 6600 support. Damian Conway's Exegesis 7... [Read More]

» Textile works from .: Bent Double :.
Well, the last post came out just fine. In fact, the only problem I had was with the blockquote function, ==bq..==, which I have to assume is attributed to posting through "Zempt (Zempt :: Multi-platform posting for Movable Type ::... [Read More]

» Textile works from .: Bent Double :.
Well, the last post came out just fine. In fact, the only problem I had was with the blockquote function, bq.., which I have to assume is attributed to posting through Zempt and it’s own HTML production on publishing a... [Read More]

» Textile works from .: Bent Double :.
Well, the last post came out just fine. In fact, the only problem I had was with the blockquote function, bq.., which I have to assume is attributed to posting through Zempt and it’s own HTML production on publishing a... [Read More]

1 Comments

Roberto said:

Hi
I'm web and Movable Type very beginner. I'm trying to build a my own photoblog and I find around a link to MTextile plugin that I feel could help me. Unfortunatly It's so hard for me to understand the correct sintax to be used. Let me to give an example:



You can find here just few information about this site and me.
My self
I'm fif…Oh let’s forget the age; it doesn’t matter. Really I’m so young!
I live in Monza, close to Milan, with my wife, two beautiful twins, Alessia and Gianluca, and two cats.
My passions are photography of course, reading, music and movies. Some time I play video games, mainly RPG and Real Time Strategy. I like also trekking on mountain to get some pure air and to fix emotions through lens.

For instance on the browser instead of quote of I'm I get strange symbols, the font size doesn't look as set in the style sheet, and other.
Where I'm faulting? I think would be enough to get some suggestion to go in the right direction.
Many thanks in advance for help
Regards
Roberto

About

This article was published on February 18, 2004 10:54 AM.

The article previously posted was Looking for a web host?.

The next article is Spam filtering with qpsmtpd.

Many more can be found on the home page or by looking through the archives.

Powered by Movable Type