diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm
index 4a2cd4860..01fe1f733 100644
--- a/fhem/FHEM/01_FHEMWEB.pm
+++ b/fhem/FHEM/01_FHEMWEB.pm
@@ -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));
diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html
index 5bc26c7d6..369ad4837 100644
--- a/fhem/docs/commandref_frame.html
+++ b/fhem/docs/commandref_frame.html
@@ -1609,8 +1609,12 @@ The following local attributes are used by a wider range of devices:
encoding
Set the internal encoding used for storing strings.
Possible values: bytestream (default) and unicode.
- Note: Since not all modules were checked, if they work correctly with
- the internal unicode encoding, this feature is experimental.
+ Notes:
+
+ - Since not all modules were checked, if they work correctly with
+ the internal unicode encoding, this feature is experimental.
+ - Changing the attribute value triggers a save and a shutdown restart
+
diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html
index 34470fb9d..7dff88a89 100644
--- a/fhem/docs/commandref_frame_DE.html
+++ b/fhem/docs/commandref_frame_DE.html
@@ -1714,8 +1714,12 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
encoding
Wählt das perl-interne Format, mit dem Strings kodiert sind.
Mögliche Werte sind: bytestream (Voreinstellung) und unicode.
- Achtung: der Wert unicode ist experimentell, da nicht alle FHEM-Module
- mit dieser Variante geprüft wurden.
+ Achtung:
+
+ - der Wert unicode ist experimentell, da nicht alle FHEM-Module
+ mit dieser Variante geprüft wurden.
+ - ändern des Wertes bewirkt ein save und ein shutdown restart.
+
diff --git a/fhem/fhem.pl b/fhem/fhem.pl
index e4cb5e73c..7cec95656 100755
--- a/fhem/fhem.pl
+++ b/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 = "";
}