Category: Programming

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.

命令行:

  1. find . -name *.module |xargs wc -l  
  2. find . -name *.inc | xargs wc -l  
  3. find . -name *.php |xargs wc -l 
  4. find . -name *.install |xargs wc -l 

PHP版本:

 

  1. exec("find /mnt/site -name *.module |xargs wc -l "$res$rc);  
  2. $res = array_reverse($res); 
  3. $t1 = explode(' '$res[0]); 
  4.  
  5. exec("find /mnt/site -name *.inc |xargs wc -l "$res$rc);  
  6. $res = array_reverse($res); 
  7. $t2 = explode(' '$res[0]); 
  8.  
  9. exec("find /mnt/site -name *.install |xargs wc -l "$res$rc);  
  10. $res = array_reverse($res); 
  11. $t3 = explode(' '$res[0]); 
  12.  
  13. echo "Total " . $t1[1] + $t2[1] + $t3[1]; 

 

1. function binhex($str) {
2. $hex = “”;
3. $i = 0;
4. do {
5. $hex .= sprintf(“%02x”, ord($str{$i}));
6. $i++;
7. } while ($i < strlen($str));
8. return $hex;
9. }
已知非正常空白: \xc2\xa0      \xe3\x80\x80

参照http://lcweb2.loc.gov/diglib/codetables/9.4.html