![]() |
Sidebar |
phpのバグ dirname関数は日本語対応未熟(php 5.3)
php6は、正常に動作しましたが 現行のバージョンは以下のコードでエラーが起きます UTF8の文字に対してdirnameは、問題ないですが 現状 utf8でファイル名を取得できるのか? // bug: php 5.3.3 , 5.2.14 // (php6:ok) mb_language("ja"); mb_internal_encoding("SJIS"); $path = "c:\\tmp\\".chr(0x83).chr(0x8b); // japanese common charset (katakana ru) $file = $path."\\test.txt"; // c:\tmp\ル\test.txt printf(" \$file : %s\n" , $file); printf(" dirname(\$file) : %s\n\n" , dirname($file)); if ( strcasecmp($path , dirname($file)) != 0 ) exit(" error : bug\n"); print "ok \n"; ?> » 続きを読む |
![]() |
Sidebar |