mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +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
|
||||
$pv =~ s/\+/ /g;
|
||||
$pv =~ s/%([\dA-F][\dA-F])/chr(hex($1))/ige;
|
||||
$pv = Encode::decode('UTF-8', $pv) if($unicodeEncoding);
|
||||
my ($p,$v) = split("=",$pv, 2);
|
||||
$v = "" if(!defined($v));
|
||||
|
||||
|
@ -1609,8 +1609,12 @@ The following local attributes are used by a wider range of devices:
|
||||
<li>encoding<br>
|
||||
Set the internal encoding used for storing strings.
|
||||
Possible values: bytestream (default) and unicode.<br>
|
||||
Note: Since not all modules were checked, if they work correctly with
|
||||
the internal unicode encoding, this feature is experimental.
|
||||
Notes:
|
||||
<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>
|
||||
|
||||
<a name="featurelevel"></a>
|
||||
|
@ -1714,8 +1714,12 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
|
||||
<li>encoding<br>
|
||||
Wählt das perl-interne Format, mit dem Strings kodiert sind.
|
||||
Mögliche Werte sind: bytestream (Voreinstellung) und unicode.<br>
|
||||
Achtung: der Wert unicode ist experimentell, da nicht alle FHEM-Module
|
||||
mit dieser Variante geprüft wurden.
|
||||
Achtung:
|
||||
<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>
|
||||
|
||||
<a name="featurelevel"></a>
|
||||
|
10
fhem/fhem.pl
10
fhem/fhem.pl
@ -2877,11 +2877,10 @@ GlobalAttr($$$$)
|
||||
my ($type, $me, $name, $val) = @_;
|
||||
|
||||
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});
|
||||
$featurelevel = 6.1 if($name eq "featurelevel");
|
||||
$haveInet6 = 0 if($name eq "useInet6"); # IPv6
|
||||
$unicodeEncoding = undef if($name eq "encoding");
|
||||
delete($defs{global}{ignoreRegexpObj}) if($name eq "ignoreRegexp");
|
||||
return undef;
|
||||
}
|
||||
@ -2904,6 +2903,13 @@ GlobalAttr($$$$)
|
||||
if($name eq "encoding") { # Should be called from fhem.cfg/configDB
|
||||
return "bad encoding parameter $val, good values are bytestream or unicode"
|
||||
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");
|
||||
$currlogfile = "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user