how to create invalid utf-8 characters in MySQL I'm trying to test some application level ruby methods and how they handle invalid utf-8. I'm trying something like to get invalid utf-8:

mysql&gt; update items set header=UNHEX('4D2AFF') where id=10938;
ERROR 1366 (HY000): Incorrect string value: '\xFF' for column 'header' at row 1


Is there a way to update a varchar(255) to invalid utf-8?
Why not changing the text strings to a binary encoding or non-utf8 encoding, or to use binary strings (varbinary, blobs)? That will allow you to store all invalid values that you want.

Edit: To be more specific: change the type to varchar(255) charset binary, that may cause you all kind of charset problems .

@RLF, funny that you mention Wikipedia, text on the wikipedia is stored in binary format!