I seem to get back garbled junk when querying google and echo /
print_r results to the browser or into my database.
For example, I can create an event manually in Google Calendar with
the title "Hellö Wörld". Simple enough. I create it with a browser,
in all ways it seems fine. Even if I manually browse to the event's
feed URL (or the calendar feed) using Safari, the special characters
show up fine.
When I run the very simple getEvent() function using PHP / Zend
framework, I get this as the title for the event: "Hellö Wörld".
I copied the getEvent() function from Demos\Zend\GData\Calendar.php
and I simply print_r() the function. The same is true if I create a
"Hellö Wörld" calendar and call outputCalendar().
Here is the getEvent() function:
<pre>
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
$user = 'willi...gmail.com';
$pass = 'password...';
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined
service name for calendar
$client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
function getEvent($client, $eventId)
{
$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser('default');
$query->setVisibility('private');
$query->setProjection('full');
$query->setEvent($eventId);
try {
$eventEntry = $gdataCal->getCalendarEventEntry($query);
return $eventEntry;
} catch (Zend_Gdata_App_Exception $e) {
var_dump($e);
return null;
}
}
print_r ( getEvent( $client, "1m9u20aru8chtq0mgg1forlag4"));
</pre>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Data Protocol" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---