I am saving some strings into database (mysql), but laravel always saves this for example "Dru" instead of "Društvo". How can I resolve this? Its cropping string at point where is character with caron. If I manually save string and then fetch it laravel correctly displays it but if I write same string in view file I just get �. Any solutions?
UTF-8.UTF-8, by setting Content-Type to text/html; charset=utf-8. Enter in russian text directly to the form input.SET NAMES utf8 so it's stored as UTF-8 before you insert the data, in a separate query beforehand.text/html; charset=utf-8.Make sure that the content-type is not windows-1251 or iso-8859-1/latin1. Make sure the database charset/coallition is NOT ISO-8859-1/Latin1.
Second way to store character in mysql:
Try calling mysql_set_charset('utf8'); after connecting to the database. I think it's similar to executing a SET NAMES query, but since the PHP manual says using that function over a SET NAMES query is recommended, I'd try it.
At last,
Also, when you display your content, you could try Also, when you display your content, you could try echo htmlentities($string, ENT_COMPAT, 'UTF-8');
I had same problem in laravel but I figure out this way.let me know if any query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With