Yahoo!ウェブホスティングのライトコースのブログ(Simple PHP Blog)

イメージ 1

「インストール支援」機能を用いて,Simple PHP Blogをインストールし,
早速,使い勝手を調べてみた.

感想としては「それなりに使えるな」というところ.

しかし,htmlタグを使用した記事を書いて投稿したところ,次のようなエラーが表示された.

Fatal error: Call to undefined function utf8_encode() in /home/vr10599/web/htdocs/blog/scripts/sb_formatting.php on line 264

どうやら,utf8_encode()が無いらしい.

問題の部分はsb_formatting.phpの以下の部分の10行目

1 if ( $str_offset !== false ) {
2	// Store all the text BETWEEN the HTML tags.
3	//
4	// Also, decode HTML entities between the tags.
5	$temp_str = substr( $str, 0, $str_offset );
6	if ( $strip_tags === false ) {
7		// $temp_str = html_entity_decode( $temp_str, ENT_QUOTES, $lang_string[ 'php_charset' ] );
8		$trans_str = get_html_translation_table(HTML_ENTITIES);
9		foreach($trans_str as $k => $v){
10			$ttr[$v] = utf8_encode($k);
11		}
12		$temp_str = strtr($temp_str, $ttr);
13	}
14	$str_out = $str_out . $temp_str;

Yahoo!ウェブホスティングサービス上のPHPutf8_encodeをサポートしていないみたいなので,非常に不味い.これでは,ブログとしての機能の半分以上が死んだも同然.

そこで,とりあえず,何とかならないかと思い,
$ttr[$v] = utf8_encode($k);



$ttr[$v] = $k;

にしてみたところ,

上手くいったみたい.

どうせ後で問題が出てくるだろうから,この設定でいろいろやってみようと思う.

なんかあったらまた報告します.