sharedbook problem

10 views
Skip to first unread message

velja

unread,
Dec 17, 2008, 1:56:24 AM12/17/08
to SharedBook APIs
Hi to all!

I am trying to create book with PHP Wrapper.
Sometimes I succeed, sometimes not due to following error "2 error:
The signature doesn't match the request parameters".

When analyzing why I got this mistake I found out that it happened
because of chapterText length.
Is there a limit for this parameter?

I get this text from MySQL text field. It is article with text and new
lines and I get it with following:
while ($data = mysql_fetch_array($res))
{
$destinations[$i] = array('chapterTitle' => stripslashes($data
['topics_title']),
'chapterText' => stripslashes($data
['topics_text'])) ;
$i++;
}

Maybe this happens because of new lines in text?

Please help!
Thanks

jplo...@sharedbook.com

unread,
Dec 18, 2008, 10:39:26 AM12/18/08
to SharedBook APIs, velj...@gmail.com
Hi Velimir,

I believe this is a problem with sending in extended or non-ascii
characters. You'll have to replace them as closely as possible with
ascii characters.

Some sample code is below. Hopefully it will cover the characters used
in your text.

$badChars=array(chr(0xe2).chr(0x80).chr(0x98),chr(0xe2).chr(0x80).chr
(0x99),chr(134),chr(145),chr(146),chr(0xe2) . chr(0x80) . chr(0x9c),chr
(0xe2) . chr(0x80) . chr(0x9d),chr(147),chr(148),chr(149),chr(0xe2) .
chr(0x80) . chr(0x93),chr(0xe2) . chr(0x80) . chr(0x94),chr(150),chr
(151),chr(169),chr(233),chr(133),chr(0xe2).chr(0x80).chr(0xa6),chr
(192),chr(193),chr(194),chr(195),chr(196),chr(197),chr(200),chr
(201),chr(202),chr(203),chr(204),chr(205),chr(206),chr(207),chr
(210),chr(211),chr(212),chr(213),chr(214),chr(217),chr(218),chr
(219),chr(220),chr(224),chr(225),chr(226),chr(227),chr(228),chr
(229),chr(232),chr(233),chr(234),chr(235),chr(236),chr(237),chr
(238),chr(239),chr(242),chr(243),chr(244),chr(245),chr(246),chr
(249),chr(250),chr(251),chr(252),chr(168));
$replaceChars=array
("'","'","","'","'",'"','"','"','"','*','-','-','-','-','C.','e','...','...','A','A','A','A','A','A','E','E','E','E','I','I','I','I','O','O','O','O','O','U','U','U','U','a','a','a','a','a','a','e','e','e','e','i','i','i','i','o','o','o','o','o','u','u','u','u','');

$cleanString=str_replace($badChars,$replaceChars,$YOUR_STRING);

John Paul
Reply all
Reply to author
Forward
0 new messages