Skip Menu |
 

This queue is for tickets about the SMS-MessageBird CPAN distribution.

Report information
The Basics
Id: 127966
Status: new
Priority: 0/
Queue: SMS-MessageBird

People
Owner: Nobody in particular
Requestors: kparkhurst [...] intellisurvey.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unicode Support Bug (SMS::MessageBird 0.03)
Date: Sat, 8 Dec 2018 02:00:35 -0800
To: bug-SMS-MessageBird [...] rt.cpan.org
From: Kaitlyn Parkhurst <kparkhurst [...] intellisurvey.com>
Hello, I'm using SMS::MessageBird and have run into an issue with sending messages with unicode. I attempted to send the following message: "I am unicode šŸ˜ !" 107 my $res = $sms->sms->send( 108 recipients => $message->phone_number, 109 body => "I am unicode šŸ˜ !", 110 originator => $origin_number->phone_number, 111 datacoding => ( $type eq 'gsm' ? 'plain' : 'unicode' ), 112 ); I got the following error: HTTP::Message content must be bytes at /usr/share/perl5/vendor_perl/HTTP/Request/Common.pm line 94. After some digging, I made the following patch for SMS/MessageBird/API.pm. and it seems to have corrected the issue: 7a8 Show quoted text
> use Encode qw( encode_utf8 );
147,148c148,149 < $request_params{'Content-Type'} = 'application/json', < $request_params{Content} = $content_payload; --- Show quoted text
> $request_params{'Content-Type'} =
'application/json;charset=utf-8', Show quoted text
> $request_params{Content} = encode_utf8($content_payload);
Thank you for your work on SMS::MessageBird, it's been wonderful to use.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.