/** @test */ public function it_encodes_an_array_of_strings() { $strings = [utf8_decode('motörheád-1'), utf8_decode('motörheád-2'), utf8_decode('motörheád-2')]; foreach ($strings as $string) { $this->assertFalse(mb_check_encoding($string, 'utf-8')); } $strings = \Sauladam\ShipmentTracker\Utils\Utils::ensureUtf8($strings); foreach ($strings as $string) { $this->assertTrue(mb_check_encoding($string, 'utf-8')); } }
/** * Set the recipient. * * @param string $recipient * * @return $this */ public function setRecipient($recipient) { $this->recipient = Utils::ensureUtf8($recipient); return $this; }
/** * Set the description. * * @param $description * * @return $this */ public function setDescription($description) { $this->description = Utils::ensureUtf8($description); return $this; }