Page 1 of 1

Danish øæå in message

Posted: 7. Aug 2018, 14:43
by petercal
Hi,

Message are not shown if i use Danish øæå characters in message.

isn't that possible ?

thanks
Peter

Re: Danish øæå in message

Posted: 7. Aug 2018, 14:50
by admin
All works fine also with danish characters
IMG_9993.jpg
IMG_9993.jpg (19 KiB) Viewed 7941 times
What device you have? How you send your notification?

Kevin

Re: Danish øæå in message

Posted: 7. Aug 2018, 14:59
by petercal
Hi Kevin

I'm sending from a perl script to iPhone SE

sub send_notify
{

my ($title, $mess, $sound, $icon, $dev) = @_;

LWP::UserAgent->new()->post(
"https://www.pushsafer.com/api", [
"t" => $title, # Title
"m" => $mess, # Message
"s" => $sound, # Sound
"v" => 2, # Vibration
"i" => $icon, # Icon
"c" => 0, # IconColor
"d" => $dev, # Device
"k" => "0X24KMnbgtrxxxxxxxxx" # key
]);

}


$message = "!! TYVERI ALARM !! modtaget fra Dørkontakt";
send_notify('** Alarmmonitor **',$message,27,1,$peterID);

thanks,
peter

[Solved] Danish øæå in message

Posted: 7. Aug 2018, 18:46
by petercal
I got it working

apt-get install liburi-encode-perl

use LWP::UserAgent;
use URI::Encode;


my $t1 = 'Testing æøå ÆØÅ';
my $uri = URI::Encode->new( { encode_reserved => 0 } );
$message = $uri->encode($t1);

send_notify('** Alarmmonitor **',$message,45,1,$peter);

And it works.

So in my subroutine i just have to encode title and message.

sub send_notify
{

my ($title, $mess, $sound, $icon, $dev) = @_;

my $uri = URI::Encode->new( { encode_reserved => 0 } );
$title = $uri->encode($title);
$mess = $uri->encode($mess);

LWP::UserAgent->new()->post(
"https://www.pushsafer.com/api",[
"t" => $title, # Title
"m" => $mess, # Message
"s" => $sound, # Sound
"v" => 2, # Vibration
"i" => $icon, # Icon
"c" => 0, # IconColor
"d" => $dev, # Device
"k" => "0X2xxxfdtergzzzxxxx" # key
]);

send_notify('Title Testing æøå ÆØÅ','Message Testing æøå ÆØÅ',45,1,$peter);





Thanks
Peter

Re: Danish øæå in message

Posted: 7. Aug 2018, 20:27
by admin
Great Peter!