Google Weather
Back to this add-on's main page
View Other Add-ons From Marcel Villerius
Problem with Greek language
Bug Report
|
Ingenious
|
| Posted: 06 December 2011 09:25 PM |
|
|
|
|
Hello,
I have been testing the plug-in and when I use as a language Greek/Russian/Bulgarian etc, I get the text not rendered properly. I guess there is some problem with the encodings.
{exp:google_weather location=“kavala” cache_refresh=“60” language=“el” imagepath=”/resources/weather/” extension=“png”}
The result I get is this:
ÊáôÜ ôüðïõò íåöåëþäçò
I checked the cache file and the whole text is right in there for example:
<?xml version=“1.0”?><xml_api_reply version=“1”><weather module_id=“0” tab_id=“0” mobile_row=“0” mobile_zipped=“1” row=“0” section=“0” ><forecast_information><city data=“Kavala, East Macedonia and Thrace”><latitude_e6 data=”“><longitude_e6 data=”“><forecast_date data=“2011-12-07”><current_date_time data=“1970-01-01 00:00:00 +0000”><unit_system data=“SI”></forecast_information><current_conditions><condition data=”Κατά τόπους νεφελώδης”><temp_f data=“45”><temp_c data=“7”><humidity data=”Υγρασία: 93%”><icon data=”/ig/images/weather/partly_cloudy.gif”><wind_condition data=”¶νεμος: Β σε 0 χμ/ώ”></current_conditions><forecast_conditions><day_of_week data=”Τετ”><low data=“1”><high data=“12”><icon data=”/ig/images/weather/chance_of_rain.gif”><condition data=”Πιθανότητα βροχόπτωσης”></forecast_conditions><forecast_conditions><day_of_week data=”Πεμ”><low data=”-2”><high data=“10”><icon data=”/ig/images/weather/sunny.gif”><condition data=”Καθαρός”></forecast_conditions><forecast_conditions><day_of_week data=”Παρ”><low data=“4”><high data=“9”><icon data=”/ig/images/weather/mostly_sunny.gif”><condition data=”Κυρίως ηλιοφάνεια”></forecast_conditions><forecast_conditions><day_of_week data=”Σαβ”><low data=“4”><high data=“11”><icon data=”/ig/images/weather/mostly_sunny.gif”><condition data=”Κυρίως ηλιοφάνεια”></forecast_conditions></weather></xml_api_reply>
|
|
|
|
|
Ingenious
|
| Posted: 07 December 2011 12:26 PM |
# 1
|
|
|
|
Same problem with russian, bulgarian and other non latin languages.
|
|
|
|
|
Ingenious
|
| Posted: 13 December 2011 01:38 PM |
# 2
|
|
|
|
No support????
|
|
|
|
|
sonic
|
| Posted: 03 April 2012 06:07 AM |
# 3
|
|
|
|
How I solved this
Find this code
$xml_str = file_get_contents('http://www.google.com/ig/api?weather=' . urlencode($location) . '&hl;=' . $language, 0); $xml = new SimplexmlElement(utf8_encode($xml_str));
Replace
$xml_str = file_get_contents('http://www.google.com/ig/api?weather=' . urlencode($location) . '&hl;=' . $language . '&ie=utf-8&oe=utf-8', 0); $xml = new SimplexmlElement($xml_str);
AND
$xml = new SimplexmlElement(utf8_encode($xml_str));
Replace
$xml = new SimplexmlElement($xml_str);
|
|
|
|