diff --git a/fhem/CHANGED b/fhem/CHANGED index 13b007dd1..169b39986 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 50_TelegramBot: contact handling failed (/ in contact names ??) - feature: new module 02_FTUISRV.pm for server side templates for tablet UI - feature: 30_pilight_switch: new attribute 'sendCount' to send the command n times. diff --git a/fhem/FHEM/50_TelegramBot.pm b/fhem/FHEM/50_TelegramBot.pm index 4cb0b2a4f..6b29d4e1c 100644 --- a/fhem/FHEM/50_TelegramBot.pm +++ b/fhem/FHEM/50_TelegramBot.pm @@ -124,7 +124,7 @@ # favorite list corrected # 1.6 2016-04-08 text customization for replies/messages and favorite descriptions -# +# Fix: contact handling failed (/ in contact names ??) # # ############################################################################## @@ -455,6 +455,7 @@ sub TelegramBot_Set($@) my $arg = join(" ", @args ); Log3 $name, 3, "TelegramBot_Set $name: set new contacts to :$arg: "; # first set the hash accordingly + $arg = TelegramBot_PutToUTF8( $arg ); TelegramBot_CalcContactsHash($hash, $arg); # then calculate correct string reading and put this into the reading @@ -2137,9 +2138,9 @@ sub TelegramBot_CalcContactsHash($$) Log3 $hash->{NAME}, 5, "Contact add :$contact: cid is not number or -number:"; next; } else { - $cname =~ TelegramBot_encodeContactString( $cname ); + $cname = TelegramBot_encodeContactString( $cname ); - $cuser =~ TelegramBot_encodeContactString( $cuser ); + $cuser = TelegramBot_encodeContactString( $cuser ); $hash->{Contacts}{$id} = $id.":".$cname.":".$cuser; } @@ -2267,6 +2268,7 @@ sub TelegramBot_encodeContactString($) { $str =~ s/ /_/g; return TelegramBot_GetUTF8Back( $str ); +# return $str; } #####################################