mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhem.pl: shutdown restart on encoding change
git-svn-id: https://svn.fhem.de/fhem/trunk@25704 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
651b9c7269
commit
88f9b0f3b8
@ -1280,6 +1280,7 @@ FW_digestCgi($)
|
|||||||
next if($pv eq ""); # happens when post forgot to set FW_ME
|
next if($pv eq ""); # happens when post forgot to set FW_ME
|
||||||
$pv =~ s/\+/ /g;
|
$pv =~ s/\+/ /g;
|
||||||
$pv =~ s/%([\dA-F][\dA-F])/chr(hex($1))/ige;
|
$pv =~ s/%([\dA-F][\dA-F])/chr(hex($1))/ige;
|
||||||
|
$pv = Encode::decode('UTF-8', $pv) if($unicodeEncoding);
|
||||||
my ($p,$v) = split("=",$pv, 2);
|
my ($p,$v) = split("=",$pv, 2);
|
||||||
$v = "" if(!defined($v));
|
$v = "" if(!defined($v));
|
||||||
|
|
||||||
|
@ -1609,8 +1609,12 @@ The following local attributes are used by a wider range of devices:
|
|||||||
<li>encoding<br>
|
<li>encoding<br>
|
||||||
Set the internal encoding used for storing strings.
|
Set the internal encoding used for storing strings.
|
||||||
Possible values: bytestream (default) and unicode.<br>
|
Possible values: bytestream (default) and unicode.<br>
|
||||||
Note: Since not all modules were checked, if they work correctly with
|
Notes:
|
||||||
the internal unicode encoding, this feature is experimental.
|
<ul>
|
||||||
|
<li>Since not all modules were checked, if they work correctly with
|
||||||
|
the internal unicode encoding, this feature is experimental.</li>
|
||||||
|
<li>Changing the attribute value triggers a save and a shutdown restart</li>
|
||||||
|
</ul>
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<a name="featurelevel"></a>
|
<a name="featurelevel"></a>
|
||||||
|
@ -1714,8 +1714,12 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
|
|||||||
<li>encoding<br>
|
<li>encoding<br>
|
||||||
Wählt das perl-interne Format, mit dem Strings kodiert sind.
|
Wählt das perl-interne Format, mit dem Strings kodiert sind.
|
||||||
Mögliche Werte sind: bytestream (Voreinstellung) und unicode.<br>
|
Mögliche Werte sind: bytestream (Voreinstellung) und unicode.<br>
|
||||||
Achtung: der Wert unicode ist experimentell, da nicht alle FHEM-Module
|
Achtung:
|
||||||
mit dieser Variante geprüft wurden.
|
<ul>
|
||||||
|
<li>der Wert unicode ist experimentell, da nicht alle FHEM-Module
|
||||||
|
mit dieser Variante geprüft wurden.</li>
|
||||||
|
<li>ändern des Wertes bewirkt ein save und ein shutdown restart.</li>
|
||||||
|
</ul>
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<a name="featurelevel"></a>
|
<a name="featurelevel"></a>
|
||||||
|
10
fhem/fhem.pl
10
fhem/fhem.pl
@ -2877,11 +2877,10 @@ GlobalAttr($$$$)
|
|||||||
my ($type, $me, $name, $val) = @_;
|
my ($type, $me, $name, $val) = @_;
|
||||||
|
|
||||||
if($type eq "del") {
|
if($type eq "del") {
|
||||||
my %noDel = ( modpath=>1, verbose=>1, logfile=>1, configfile=>1 );
|
my %noDel = ( modpath=>1, verbose=>1, logfile=>1, configfile=>1, encoding=>1 );
|
||||||
return "The global attribute $name cannot be deleted" if($noDel{$name});
|
return "The global attribute $name cannot be deleted" if($noDel{$name});
|
||||||
$featurelevel = 6.1 if($name eq "featurelevel");
|
$featurelevel = 6.1 if($name eq "featurelevel");
|
||||||
$haveInet6 = 0 if($name eq "useInet6"); # IPv6
|
$haveInet6 = 0 if($name eq "useInet6"); # IPv6
|
||||||
$unicodeEncoding = undef if($name eq "encoding");
|
|
||||||
delete($defs{global}{ignoreRegexpObj}) if($name eq "ignoreRegexp");
|
delete($defs{global}{ignoreRegexpObj}) if($name eq "ignoreRegexp");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -2904,6 +2903,13 @@ GlobalAttr($$$$)
|
|||||||
if($name eq "encoding") { # Should be called from fhem.cfg/configDB
|
if($name eq "encoding") { # Should be called from fhem.cfg/configDB
|
||||||
return "bad encoding parameter $val, good values are bytestream or unicode"
|
return "bad encoding parameter $val, good values are bytestream or unicode"
|
||||||
if($val ne "unicode" && $val ne "bytestream");
|
if($val ne "unicode" && $val ne "bytestream");
|
||||||
|
if($init_done) {
|
||||||
|
InternalTimer(0, sub {
|
||||||
|
CommandSave(undef, undef);
|
||||||
|
CommandShutdown(undef, "restart");
|
||||||
|
}, undef);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$unicodeEncoding = ($val eq "unicode");
|
$unicodeEncoding = ($val eq "unicode");
|
||||||
$currlogfile = "";
|
$currlogfile = "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user