Re: [請益] html unicode

看板PHP作者 (鬼接)時間16年前 (2009/06/06 17:04), 編輯推噓3(302)
留言5則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《buganini (霸格尼尼)》之銘言: : http://github.com/buganini/bsdconv : 如果你是用FreeBSD或Linux可以試一下 : Linux編譯的時候LDFLAGS要加個-ldl : 裡面有php的wrapper : 外面先make && make install之後 : 到wrapper/php/ : phpize : ./configure LDARGS="-lbsdconv" : make : make install : 然後php裡面可以用 : $h=bsdconv_create('htmlentity,big5,ascii::utf-8'); : $str=bsdconv($h,$str); : bsdconv_destroy($h); : 就可以把$str轉成utf-8 感謝,我使用的是RHEL5.3 x64 , 一開始無法直接make & make install 於是安裝gcc套件: yum install gcc 再Makefile加上一行: CC=/usr/bin/gcc -ldl 這時外部已經可以順利make & make install 接下來進入wrapper/php, 系統沒有phpize 於是安裝php-devel套件: yum install php-devel 接下來: /usr/bin/phpize ./configure LDARGS="-lbsdconv" 到這裡還算順利 接下來: make : 發現沒有bsdconv.h 於是到外層的 build/include 把 bsdconv.h 複製到 wrapper/php 順利 make & make install 成功 最後安裝到這裡: Installing shared extensions: /usr/lib64/php/modules/ 裝進去了 還未測試 等測試後小弟再發一篇 感謝buganini ^_< -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.117.24.1 ※ 編輯: Gjoy 來自: 140.117.24.1 (06/06 17:05)

06/06 20:17, , 1F
忘了說 預設路徑我是寫/usr/local/ (FreeBSD style)
06/06 20:17, 1F

06/06 20:17, , 2F
Linux可以用make PERFIX=/usr
06/06 20:17, 2F

06/06 21:28, , 3F
make PREFIX=/usr
06/06 21:28, 3F

06/07 10:39, , 4F
如果抓出來的資料 許功蓋 有多餘\的話
06/07 10:39, 4F

06/07 10:40, , 5F
用htmlentity,big5-5c,big5,ascii::utf-8
06/07 10:40, 5F
文章代碼(AID): #1AAZ4JmB (PHP)
討論串 (同標題文章)
文章代碼(AID): #1AAZ4JmB (PHP)