hallo,
ich versuche mit simplexml die wetter api von google zu parsen, was auch wunderbar funktioniert, doch nur wenn die sprache auf englisch eingestellt ist.
Wenn ich die Wetterdaten auf deutsch haben möchte, bringt er mir ein fehler der so aussieht :
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.google.com/ig/api?hl=de&weather=providence parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xF6 0x6C 0x6B 0x74 in C:\xampp\htdocs\test.php on line 8
Warning: simplexml_load_file() [function.simplexml-load-file]: data="SI"/></forecast_information><current_conditions><conditio n data="Teils bew in C:\xampp\htdocs\test.php on line 8
er hat probleme mit den umlauten so wie ich es seh^^
und der php code sieht so aus :
theoretisch dürfte er mir garkeine fehlermeldung bringen sondern die umlaute nur falsch anzeigen oder nicht?
ich versuche mit simplexml die wetter api von google zu parsen, was auch wunderbar funktioniert, doch nur wenn die sprache auf englisch eingestellt ist.
Wenn ich die Wetterdaten auf deutsch haben möchte, bringt er mir ein fehler der so aussieht :
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.google.com/ig/api?hl=de&weather=providence parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xF6 0x6C 0x6B 0x74 in C:\xampp\htdocs\test.php on line 8
Warning: simplexml_load_file() [function.simplexml-load-file]: data="SI"/></forecast_information><current_conditions><conditio n data="Teils bew in C:\xampp\htdocs\test.php on line 8
er hat probleme mit den umlauten so wie ich es seh^^
und der php code sieht so aus :
PHP Code:
$pfad = 'http://www.google.com/ig/api?hl=de&weather='.$city;
$xml = simplexml_load_file($pfad);
$information = $xml->xpath("/xml_api_reply/weather/forecast_information");
$current = $xml->xpath("/xml_api_reply/weather/current_conditions");
$forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
Comment