Jump to content


- - - - -

RSS import - XML error: Invalid character at line 4


  • Please log in to reply
2 replies to this topic

#1 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 19 December 2011 - 11:42 PM

Quote

Validation Results for http://www.zdnet.com...ws_hardware.htm
·HTTP Status Code: 200 (OK)
·XML error: Invalid character at line 4

What can i do? Posted Image

Thanks.

#2 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 20 December 2011 - 10:56 AM

This is either an issue with IP.Board, PHP or the RSS stream. The stream uses an encoding named "BIG5". This encoding is not supported by the multibyte string functions in PHP, but "BIG-5" is. Setting the character conversion method in IP.Board to "mb functions", and the edit below got around this issue.

Open ./ips_kernel/classRss.php
Find:
if( !$this->orig_doc_type AND preg_match( "#charset=(\S+?)#si", $data, $matches ) )
  {
   $this->orig_doc_type = strtoupper($matches[1]);
   $_foundIn	= 'charset';
  }
Add below:
$this->orig_doc_type = $this->orig_doc_type == "BIG5" ? 'BIG-5' : $this->orig_doc_type;
Save and upload

I don't know if the outcome of this is correct (character encoding etc) is correct, so you may want to try it on a test board first.

#3 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 21 December 2011 - 12:28 AM

After editing the codes that you mention about, it still no works and smae error messages.
Thanks.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users