メモ: U+2028,U+2029が含まれるJSONデータをeval関数を使ってデコードするとエラーになる

※firefoxとwebkitで確認してます。 JSONを使ってデータをやり取りするととっても便利なのですが、最近それでハマったのでメモ。 UNICODEには、改行文字がいろいろと定義されているみたいです。 UAX #13: Unicode Newline Guidelines ...

11月 23, 2009 · nojimage

wordpress 2.8.5 から 2.8.6 の変更ファイル一覧

たまには更新しないとな、ということで子ネタ。 wordpress 2.8.5から 2.8.6 で修正されたファイルの一覧(日本語版)です。 wordpress/readme.html wordpress/wp-admin/press-this.php wordpress/wp-content/languages/continents-cities-ja.po wordpress/wp-content/languages/ja.mo wordpress/wp-content/languages/ja.po wordpress/wp-content/plugins/akismet/akismet.php wordpress/wp-content/plugins/akismet/readme.txt wordpress/wp-content/themes/default/style.css wordpress/wp-includes/formatting.php wordpress/wp-includes/functions.php wordpress/wp-includes/js/swfupload/plugins/swfupload.speed.js wordpress/wp-includes/version.php これを、tarとかで固めてアップロードすれば、全部アップロードするより早いのかなと。 ...

11月 20, 2009 · nojimage

メモ:poeditを使うときの注意点

CakePHP のおいしい食べ方: CakePHP1.2の簡単国際化 [カタログ]⇒[設定]から、この翻訳ファイルに関する情報を追加できますが、その際、[複数形:]というところを、 nplurals=1; plural=0; としておきましょう。

8月 24, 2009 · nojimage

WPtoTwitterプラグインのテストとして長いタイトルのエントリーを投稿して見る

適当すぎるけどこんな感じのパッチ。 wp-to-twitter-mb.patch *** wp-to-twitter.php 2009-08-20 22:04:29.000000000 +0900 --- wp-to-twitter-fixed.php 2009-08-20 22:36:38.000000000 +0900 *************** *** 206,227 **** $sentence = $sentence . " " . get_option( 'jd_twit_append' ); } ! $twit_length = strlen( $sentence ); ! $title_length = strlen( $thisposttitle ); ! $blog_length = strlen( $thisblogtitle ); if ( ( ( $twit_length + $title_length ) - 7 ) < 140 ) { $sentence = str_ireplace( '#title#', $thisposttitle, $sentence ); ! $twit_length = strlen( $sentence ); } else { ! $thisposttitle = substr( $thisposttitle, 0, ( 140- ( $twit_length-3 ) ) ) . "..."; $sentence = str_ireplace ( '#title#', $thisposttitle, $sentence ); ! $twit_length = strlen( $sentence ); } if ( ( ( $twit_length + $blog_length ) - 6 ) < 140 ) { $sentence = str_ireplace ( '#blog#',$thisblogtitle,$sentence ); ! $twit_length = strlen( $sentence ); } else { ! $thisblogtitle = substr( $thisblogtitle, 0, ( 140-( $twit_length-3 ) ) ) . "..."; $sentence = str_ireplace ( '#blog#',$thisblogtitle,$sentence ); } return $sentence; --- 206,230 ---- $sentence = $sentence . " " . get_option( 'jd_twit_append' ); } ! mb_internal_encoding('UTF-8'); ! $thisposttitle = urldecode($thisposttitle); ! $thisblogtitle = urldecode($thisblogtitle); ! $twit_length = mb_strlen( $sentence ); ! $title_length = mb_strlen( $thisposttitle ); ! $blog_length = mb_strlen( $thisblogtitle ); if ( ( ( $twit_length + $title_length ) - 7 ) < 140 ) { $sentence = str_ireplace( '#title#', $thisposttitle, $sentence ); ! $twit_length = mb_strlen( $sentence ); } else { ! $thisposttitle = mb_substr( $thisposttitle, 0, ( 140- ( $twit_length-3 ) ) ) . "..."; $sentence = str_ireplace ( '#title#', $thisposttitle, $sentence ); ! $twit_length = mb_strlen( $sentence ); } if ( ( ( $twit_length + $blog_length ) - 6 ) < 140 ) { $sentence = str_ireplace ( '#blog#',$thisblogtitle,$sentence ); ! $twit_length = mb_strlen( $sentence ); } else { ! $thisblogtitle = mb_substr( $thisblogtitle, 0, ( 140-( $twit_length-3 ) ) ) . "..."; $sentence = str_ireplace ( '#blog#',$thisblogtitle,$sentence ); } return $sentence;

8月 20, 2009 · nojimage

開発初期段階でのチケット発行

BTSにチケットを登録するときは、機能丸ごと登録しちゃうとなかなか完了しなくて鬱なので、「○○機能α版作成」として登録すると幸せになれるかもしれない。 ...

6月 3, 2009 · nojimage

perl 5.6.1 へ movable type を入れたメモ

素直に、5.8系にperlアップデートできればいいんですが、もろもろの事情で出来なかったので5.6でMT4.2を無理やり動くようにしたときのメモ。 extlib/Locale/Maketext/Guts.pmの20行目あたりを ...

10月 11, 2008 · nojimage

Webページタイトルの表記方法

Webページのタイトルの表記方法について。 主に、 サイト名 | ページ名 か、 ページ名 | サイト名 のパターンだと思うのですが、検索エンジンでの表示を考えると後者の ページ名 | サイト名 が、ユーザフレンドリーかなと思ったのでメモ。 ...

8月 18, 2008 · nojimage