< 名前付き引数をサクッとハッシュ化する | レコードセット→XML→HTMLなレシピ >

December 19, 2003

文字列を折り返す・・・とか

「New Comment Posted to の文字化けをなおす。」でみた、Movable Typeのメールの本文作成するとこ

require Text::Wrap;
$Text::Wrap::cols = 72;
$body = Text::Wrap::wrap('', '', $body) . "\n$link_url\n\n" .
	$app->translate('IP Address:') . ' ' . $comment->ip . "\n" .
	$app->translate('Name:') . ' ' . $comment->author . "\n" .
	$app->translate('Email Address:') . ' ' . $comment->email . "\n" .
	$app->translate('URL:') . ' ' . $comment->url . "\n\n" .
	$app->translate('Comments:') . "\n\n" . $comment->text . "\n";

$body	 = jcode( $body )->jfold(( 72, "\n" ));
$body	.= "\n$link_url\n\n" .
	$app->translate('IP Address:') . ' ' . $comment->ip . "\n" .
	$app->translate('Name:') . ' ' . $comment->author . "\n" .
	$app->translate('Email Address:') . ' ' . $comment->email . "\n" .
	$app->translate('URL:') . ' ' . $comment->url . "\n\n" .
	$app->translate('Comments:') . "\n\n" . $comment->text . "\n";

のがよさげか?

トラックバック

このエントリーにトラックバック:
http://frog.raindrop.jp/cgi-bin/mt/mt-tb.cgi/143

コメント

コメントする

※ コメントスパム対策のため、コメント本文はおはよう、こんにちわ、こんばんわのいずれかより始めるようにしてください。

name:
email:

※ 必要ですが、表示しません。

url:
情報を保存する ?