软件随想录在线阅读

December 11th, 2009

中文版http://local.joelonsoftware.com/wiki/Chinese_(Simplified)

shupi.jpg

作者Jole和译者阮一峰都是很有意思的人,强烈推荐

 

Protected: urls

December 10th, 2009

This post is password protected. To view it please enter your password below:


Not supported UTF-8 range [\xf0\x9d\x90\x80-\xf0\x9d\x9f\xbf]

December 4th, 2009

IE8 & Mysql & Sql server (UTF-8) Not support the files include characters [\xf0\x9d\x90\x80-\xf0\x9d\x9f\xbf].

We can replace them with *HTML Entity (decimal)* to save them into DB server, if you want use the binary of these characters, you can replace them back.

But Firefox can rightly display some of them.

The outcome of *Wikipedia*, Mysql server (also IE8) not support high code characters :

http://bugs.mysql.com/bug.php?id=14052

useful urls:

http://www.isthisthingon.org/unicode/pfpopup.php?page=1D&subpage=4

http://www.fileformat.info/info/unicode/block/mathematical_alphanumeric_…

The best solution is to upgrade to MYSQL 6.0 and use utf-16 or utf-32 encoding, but Mysql 6.0 is so new and utf-16 is not widely supported by browser or open source software.

Missing arrow symbol of XML (xml_parse_into_struct)

December 4th, 2009

When relate to the following codes:

$p = xml_parser_create();
xml_parse_into_struct($p, $xml, $vals, $index);
xml_parser_free($p);

The arrow symbol are missing, this is Bug of libxml2 with php,

when using PHP <= 5.2.6 with libxml2 >= 2.6.32.

This is due to an intentional change in the behaviour of libxml2 after version 2.6.32. Some sites suggest reverting to libxml2-2.6.30 – while this works as a temporary solution, it is no longer necessary or advisable.

PHP 5.2.7 or higher works with the new behaviour of libxml2 ( see: http://bugs.php.net/bug.php?id=45996 ). Simply upgrading PHP corrects the problem.

Now replace these special characters with HTML Entity. And can be rightly treated by libxml2.

Do the following repacement before parser the xml can resolve this problem:

$xml =str_replace(“<”,”<”,$xml);
$xml =str_replace(“>”,”>”,$xml);
$xml =str_replace(“&”,”&”,$xml);

odt文件竟然不能解压

December 4th, 2009

odt和docx文件都是通过zip进行压缩的,在测试我们的odt文件解析程序的时候发现某odt文件可以用Open Office顺利的打开,但是用解压库得不到解压文件,用WINRAR之类的工具也不能打开,百思不得其解。难道odt还有其他格式没经过压缩?
后将文件名改为doc,竟然能用WORD2003顺利打开,原来这是个doc文件,而且Open Office是兼容DOC文件的。
假象让人做出错误判断。