From 72b3ae148c39eb7076e4fa8e06c933fbb9c531f1 Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Wed, 9 Apr 2014 18:57:05 +0000 Subject: [PATCH] 98_openweathermap - added utf8 conversion for station name git-svn-id: https://svn.fhem.de/fhem/trunk@5500 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_openweathermap.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_openweathermap.pm b/fhem/FHEM/98_openweathermap.pm index 97f4dbdc6..1931df8c4 100644 --- a/fhem/FHEM/98_openweathermap.pm +++ b/fhem/FHEM/98_openweathermap.pm @@ -434,7 +434,7 @@ sub UpdateReadings($$$){ readingsBulkUpdate($hash, $prefix."sunrise", $jsonWeather->{city}{sun}{rise}); readingsBulkUpdate($hash, $prefix."sunset", $jsonWeather->{city}{sun}{set}); readingsBulkUpdate($hash, $prefix."stationId", $jsonWeather->{city}{id}); - readingsBulkUpdate($hash, $prefix."stationName", $jsonWeather->{city}{name}); + readingsBulkUpdate($hash, $prefix."stationName", utf8ToLatin1($jsonWeather->{city}{name})); readingsBulkUpdate($hash, $prefix."stationCountry", $jsonWeather->{city}{country}); readingsBulkUpdate($hash, $prefix."stationLat", sprintf("%.4f",$jsonWeather->{city}{coord}{lat})); readingsBulkUpdate($hash, $prefix."stationLon", sprintf("%.4f",$jsonWeather->{city}{coord}{lon})); @@ -479,7 +479,7 @@ sub UpdateReadings($$$){ readingsBulkUpdate($hash, "_decodedWith", "JSON"); readingsBulkUpdate($hash, $prefix."stationId", $jsonWeather->{id}); readingsBulkUpdate($hash, $prefix."lastRxCode", $jsonWeather->{cod}); - readingsBulkUpdate($hash, $prefix."stationName", $jsonWeather->{name}); + readingsBulkUpdate($hash, $prefix."stationName", utf8ToLatin1($jsonWeather->{name})); readingsBulkUpdate($hash, $prefix."humidity", $jsonWeather->{main}{humidity}); readingsBulkUpdate($hash, $prefix."pressureAbs", $jsonWeather->{main}{pressure}); readingsBulkUpdate($hash, $prefix."pressureRel", $jsonWeather->{main}{sea_level});