chat icon indicating copy to clipboard operation
chat copied to clipboard

BUG: It's not saving Kurdish or Alphabetic characters properly

Open Xoshbin opened this issue 4 years ago • 0 comments

When creating a new conversation and trying to update the conversation title and description, all the characters are separated by slashes:

"data": [
        {
            "id": 217,
            "conversation_id": 217,
            "messageable_id": 2,
            "messageable_type": "App\\User",
            "settings": null,
            "created_at": "2020-07-22T23:04:50.000000Z",
            "updated_at": "2020-07-22T23:05:22.000000Z",
            "private": 1,
            "direct_message": 1,
            "data":"{\"title\":\"\ل\ا\ن\س\ه \ر \م\ه \ك\ي\ن\ه \ق\ر\ش \٢\٠ \ا\و\ت\و\م\ا\ت\ي\ك  \س\ب\ي \ب\ف\ر \ي\",\"description\":\"\ل\ا\ن\س\ه \ر \م\ه \ك\ي\ن\ه \ق\ر\ش \٢\٠ \ا\و\ت\و\م\ا\ت\ي\ك  \س\ب\ي \ب\ف\ر \ي\"}",
            "conversation": {

To Reproduce Make a new conversation, then update it's title and description with an alphabetic characters like Kurdish or Arabic.

$data = ['title' => 'بە فەرمی مباپێ داهاتووی خۆی یەكلایی كردەوە', 'description' => 'بە فەرمی مباپێ داهاتووی خۆی یەكلایی كردەوە'];
$conversation = Chat::createConversation($participants)->makeDirect();
$conversation->update(['data' => $data]);

Expected behavior Expected to save the data without slashes just like below when returned from json resource:

"data": [
        {
            "id": 217,
            "conversation_id": 217,
            "messageable_id": 2,
            "messageable_type": "App\\User",
            "settings": null,
            "created_at": "2020-07-22T23:04:50.000000Z",
            "updated_at": "2020-07-22T23:05:22.000000Z",
            "private": 1,
            "direct_message": 1,
            "data":"{\"title\":\"بە فەرمی مباپێ داهاتووی خۆی یەكلایی كردەوە\",\"description\":\"بە فەرمی مباپێ داهاتووی خۆی یەكلایی كردەوە\"}",
            "conversation": {

Screenshots Screenshot from PhpMyAdmin: https://prnt.sc/tmvzri

Xoshbin avatar Jul 22 '20 23:07 Xoshbin