mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
59_Wunderground: fix UTF8 encoding
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12669 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6db0b7b292
commit
09f177490c
@ -31,7 +31,8 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use vars qw(%data);
|
use vars qw(%data);
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
use Encode;
|
use utf8;
|
||||||
|
use Encode qw(encode_utf8 decode_utf8);
|
||||||
use Unit;
|
use Unit;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
@ -701,8 +702,13 @@ sub Wunderground_Hash2Readings($$;$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$reading = "fc" . $period . "_";
|
$reading = "fc" . $period . "_";
|
||||||
$h->{fcttext_metric} =~ s/(\d)C/$1°C/g;
|
my $symbol_c = Encode::encode_utf8( chr(0x202F) . chr(0x00B0) . 'C' );
|
||||||
$h->{fcttext} =~ s/(\d)F/$1 °F/g;
|
my $symbol_f = Encode::encode_utf8( chr(0x202F) . chr(0x00B0) . 'F' );
|
||||||
|
my $symbol_pct = Encode::encode_utf8( chr(0x00A0) . '%' );
|
||||||
|
$h->{fcttext_metric} =~ s/(\d)C/$1$symbol_c/g;
|
||||||
|
$h->{fcttext} =~ s/(\d)F/$1$symbol_f/g;
|
||||||
|
$h->{fcttext_metric} =~ s/(\d)\s*%/$1$symbol_pct/g;
|
||||||
|
$h->{fcttext} =~ s/(\d)\s*%/$1$symbol_pct/g;
|
||||||
|
|
||||||
readingsBulkUpdate( $hash, $reading . "icon$night",
|
readingsBulkUpdate( $hash, $reading . "icon$night",
|
||||||
$h->{icon} );
|
$h->{icon} );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user