MySQL Forums
Forum List  »  General

utf8 support
Posted by: Gabriel Marais
Date: June 12, 2014 11:26PM

Hi Guys

I have been reading up on supporting UTF8 characters i.e. è (and alike). I need to support a wide range of characters in my database and ave made some adjustments in my my.cnf config file to enable UTF8 support as I understand that is what is needed. I am able to insert characters like the '$' sign but something like a 'è' cannot be inserted.

Some of the additional configs added to my my.cnf file include:-

[client]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

I have tried changing the db engine between INNODB and MyISAM but I am not able to get the desired characters inserted into the tables.

From the console :-
mysql> insert into new_table set id ='', user = 'andrè';
Query OK, 1 row affected, 2 warnings (0.00 sec)


mysql> show warnings;
+---------+------+------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------+
| Warning | 1366 | Incorrect integer value: '' for column 'id' at row 1 |
| Warning | 1265 | Data truncated for column 'user' at row 1 |
+---------+------+------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> select * from new_table;
+----+------+
| id | user |
+----+------+
| 1 | andr |
| 2 | $5 |
| 3 | andr |
+----+------+
3 rows in set (0.00 sec)



mysql> show create table new_table; \g
+-----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| new_table | CREATE TABLE `new_table` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 |
+-----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


I hope this is enough information for anyone to assist.


Regards, Gabriel

Options: ReplyQuote


Subject
Written By
Posted
utf8 support
June 12, 2014 11:26PM
June 15, 2014 10:07AM
June 26, 2014 05:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.