How can we store any text language (English, Hindi, Spanish etc) and extract the same value from the database

We allow the user to enter any language in the text field and that the value I am stored in the database, and we return the same language to the user when the user views the browser.

when I passed the value "Sant Juliã De Lã²ria" in the database, and when I get from the database, then display it as "Sant Juli De L ria"

How can we display a user with the same value as user input in text fields

+4
source share
2 answers

Use this code before pasting

mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'");
mysql_query($qry);
0
source

mysqld ( my.cnf)

[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

db,

0

Source: https://habr.com/ru/post/1545375/


All Articles