# MySQL is truncating data - Incorrect string value \xA3

## buzzin

Hello,

Im having problems with Mysql. It seems to truncate fields when it sees curtain characters.  Both the Table and database are UTF8. This happens from both the shell and php (edit: php side fixed).

Any ideas?

shell query showing the problem

```

mysql> insert into test (test) values ('test £ test');

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show warnings ;

+---------+------+----------------------------------------------------------------+

| Level   | Code | Message                                                        |

+---------+------+----------------------------------------------------------------+

| Warning | 1366 | Incorrect string value: '\xA3 test' for column 'test' at row 1 |

+---------+------+----------------------------------------------------------------+

1 row in set (0.00 sec)

mysql> select * from test;

+-------+

| test  |

+-------+

| test  |

+-------+

1 row in set (0.00 sec)

```

DB info

```

mysql> show create database test;

+----------+---------------------------------------------------------------+

| Database | Create Database                                               |

+----------+---------------------------------------------------------------+

| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8 */ |

+----------+---------------------------------------------------------------+

1 row in set (0.00 sec)

```

Table info

```

mysql> show create table test;

+-------+------------------------------------------------------------------------------+

| Table | Create Table                                                                 |

+-------+------------------------------------------------------------------------------+

| test  | CREATE TABLE `test` (

  `test` longtext

) ENGINE=MyISAM DEFAULT CHARSET=utf8 |

+-------+------------------------------------------------------------------------------+

1 row in set (0.00 sec)

```

```

emerge -pv mysql

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild     U ] dev-db/mysql-5.0.70-r1  USE="berkdb latin1 perl ssl -big-tables -cluster -debug -embedded -extraengine -max-idx-128 -minimal (-selinux) -static" 109 kB

```

Last edited by buzzin on Wed Dec 03, 2008 5:26 pm; edited 1 time in total

----------

## buzzin

Opps, i forgot i sorted this out in PHP a year ago on this thread  :Embarassed: 

But still have the problem from a shell. How would i check if my shell is using utf8?

----------

