smsapi / smsapi-php-client

SMSAPI PHP client that allows you to send messages, manage Short URLs and administrate your SMSAPI account.
https://www.smsapi.pl
Other
64 stars 39 forks source link

Have no idea how to set encoding to UTF-8 #82

Closed shortcodes closed 5 years ago

shortcodes commented 5 years ago

Currently i tried to send a sms message with UTF-8 characters in polish language. Sms is being sended correctly but it has bushes instead of proper utf-8 characters. There is no place in this library documentation describing how to set it and i am feeling like the only one who is using this API. No one encounter this problem at this version??

maciejlew commented 5 years ago

Try to set SendSmsBag property:

<?php

declare(strict_types=1);

use Smsapi\Client\Feature\Sms\Bag\SendSmsBag;

$sms = SendSmsBag::withMessage('someone phone number', 'some message');
$sms->encoding = 'utf-8';
maciejlew commented 5 years ago

Added to FAQ: How to use optional request parameters?

shortcodes commented 5 years ago

Excelent. It works! Thanks

maciejlew commented 3 years ago

UTF-8 is being set as default encoding starting from version 3.0.0. User do not have to set it explicitly.