เมนูหลัก

iconv()

เริ่มโดย jaja, 05 เมษายน 2007, 23:31:00

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

jaja

ตอนผมลง Script ตัวนึง (rss feed) มันขึ้นมาว่าอย่างเนี้ยครับ

Fatal error: Call to undefined function: iconv() in.............

มันคืออะไรเหรอครับ

kahn

ไม่มี function iconv(); อยู่ไงครับ  :D
อาจจะขาดบางไฟล์ไปนะครับ ลองหาดู
[direct=http://www.theblogmagic.com/?promocode=MQ==]>>> โปรโมชั่น Blog Magic สุดคุ้ม นาน ๆ มีที ช้าอดนะจ้าาา คลิกเลย [/direct]Blog Magic Support Forums << pm สอบถามรายละเอียดได้ที่ Support Forums จะตอบรวดเร็วกว่านะครับผม

Tee++;

iconv คงโดน Host ปิดอยู่ ลองติดต่อไปที่ hosting สิครับ บางแห่งก็ไม่ยอมเปิดตัวนี้ให้
[direct=http://laravel.in.th]Laravel in Thai[/direct]
[direct=http://jquerytips.com]jQueryTips by Tee++;[/direct]
[direct=https://www.facebook.com/jQueryTips]jQueryTips Page[/direct]
[direct=https://www.facebook.com/Laravel.in.th]Laravel in Thai Page[/direct]
[direct=https://twitter.com/Teepluss]Teepluss's Twitter[/direct]



Pipo

อ้างถึงจาก: jajaมันเกียวกับอะไรเหรอครับ

เป็น Extension ของ PHP ครับ
เอาไว้แปลง Charactor ไปมา เช่น TIS-620 ไปเป็น UTF-8



This module contains an interface to iconv character set conversion facility. With this module, you can turn a string represented by a local character set into the one represented by another character set, which may be the Unicode character set. Supported character sets depend on the iconv implementation of your system. Note that the iconv function on some systems may not work as you expect. In such case, it'd be a good idea to install the GNU libiconv library. It will most likely end up with more consistent results.

kahn

ผมไม่เคยใช้มันเลยอ่า ไม่รู้ด้วยซ้ำว่ามีให้ใช้  :lol:
[direct=http://www.theblogmagic.com/?promocode=MQ==]>>> โปรโมชั่น Blog Magic สุดคุ้ม นาน ๆ มีที ช้าอดนะจ้าาา คลิกเลย [/direct]Blog Magic Support Forums << pm สอบถามรายละเอียดได้ที่ Support Forums จะตอบรวดเร็วกว่านะครับผม

jaja

ถ้า โฮสมันไม่ Support จริงๆ

เราลบมันทิ้งได้เป่าครับโคดมันเป็นอย่างงี้อะ (ย่อมาครับ)

***************************************
// if there is some result... process it and return it
      if(isset($out[1])) {
         // Process CDATA (if present)
         if ($this->CDATA == 'content') { // Get CDATA content (without CDATA tag)
            $out[1] = strtr($out[1], array('<![CDATA['=>'', ']]>'=>''));
         } elseif ($this->CDATA == 'strip') { // Strip CDATA
            $out[1] = strtr($out[1], array('<![CDATA['=>'', ']]>'=>''));
         }

         // If code page is set convert character encoding to required
         if ($this->cp != '')
            //$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
            $out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);
         // Return result
         return trim($out[1]);
      } else {
      // if there is NO result, return empty string
         return '';
      }
   }
***************************************

ผมไม่ค่อยรู้เรื่อง PHP หนะครับ  

:cry:

Pipo

ผมว่าลองแก้จาก

//$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
$out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);


แก้เป็น

$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
//$out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);


เหมือนว่าคนเขียนทำ Function ไว้เองกรณีไม่มี iconv อยู่แล้ว
หรือถ้ามันไม่ได้จริงก็ลอง ใส่ Comment มันให้หมดจะได้ไม่ต้องแปลง

//$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
//$out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);

jaja

ได้แล้วครับ ขอบคุณมากๆๆๆๆๆ  เลยครับ

ลองแก้มันเป็นแบบนี้ครับ


//$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
//$out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);


มันเป็นสคิบของ late rss หนะครับ

http://lastrss.oslab.net/

เอามา จาก thaisarn.com หนะครับ

ขอบคุณอีกทีครับ