2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

latin1ToUtf8 added

git-svn-id: https://svn.fhem.de/fhem/trunk@3598 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-08-06 07:18:41 +00:00
parent 38b53cf68c
commit 4b093f189d

View File

@ -97,6 +97,7 @@ sub redirectStdinStdErr();
sub setGlobalAttrBeforeFork($);
sub setReadingsVal($$$$);
sub evalStateFormat($);
sub latin1ToUtf8($);
sub CommandAttr($$);
sub CommandDefaultAttr($$);
@ -3420,4 +3421,13 @@ computeClientArray($$)
return \@a;
}
sub
latin1ToUtf8($)
{
# http://perldoc.perl.org/perluniintro.html, UNICODE IN OLDER PERLS
my ($s)= @_;
$s =~ s/([\x80-\xFF])/chr(0xC0|ord($1)>>6).chr(0x80|ord($1)&0x3F)/eg;
return $s;
}
1;