0

I have an issue with Laravel 5.6.39 but I believe it is related to MySql because when I try raw SQL query it works in some cases.

I tried with raw SQL query:

// not working but should 
->where('column', 'LIKE', '%' . 'Za vjen\u010danja' . '%')

// working but it is interesting because example above doesn't work
->where('column', 'LIKE', '%' . 'Za vje' . '%')

In the database array is encoded to JSON:

// initial array
$array = ['Za vjenčanja'];

// retrieved raw from database 
$raw = '["Za vjen\u010danja"]';

It seems that characters like č, ć, ž, etc. are encoded and then query doesn't work but with basic characters from the English alphabet, it works.

*edit I think this question is not duplicate, everything is set up out of the box. Laravel will do all encoding setup. Column type used for this is TEXT utf8mb4_unicode_ci

0 Answers0