"Incorrect String" error; have utf8 everywhere
Posted by: Laird Nelson
Date: August 27, 2009 02:44PM

Hello; I'm getting the infamous Incorrect String error when loading a standard set of country data. My database is set up to use utf8 everywhere it could possibly be set.

Here is the output of my MySQL 5 installation's "status" command:
mysql> status
--------------
mysql Ver 14.12 Distrib 5.0.67, for Win32 (ia32)

Connection id: 25
Current database: sfh
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 3 min 15 sec

Threads: 1 Questions: 211 Slow queries: 0 Opens: 69 Flush tables: 1 Open tables: 31 Queries per second avg: 1.082
--------------

Note that I'm utf8 everywhere, so I'm not falling into the usual trap.

I am loading country data into a Country table like so:

mysql -umyuser -ppassword --default-character-set=utf8 --verbose --delimiter=";" --execute="SET NAMES 'utf8'; LOAD DATA LOCAL INFILE 'Country.txt' REPLACE INTO TABLE Country FIELDS TERMINATED BY ';' (ISO3CountryCode, text); SHOW WARNINGS;" my_database

I get this error:
ERROR 1366 (HY000) at line 1: Incorrect string value: '\xC5land ...' for column 'text' at row 5

The Country.txt file is essentially a dump of http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3; the country display name whose code is "ALA" is the one that is screwing up the works.

What am I doing wrong?

Thanks,
Laird



Edited 1 time(s). Last edit at 08/27/2009 03:01PM by Laird Nelson.

Options: ReplyQuote


Subject
Views
Written By
Posted
"Incorrect String" error; have utf8 everywhere
4549
August 27, 2009 02:44PM


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.