dummy-line-for-utf8-textfile-start-character. -- This is a script documenting a strange problem I encountered with Arabic: -- I am working on PC / Windows XP with MySQL 4.1.10a - just updated from 4.1.7: -- ONE letter (Feh, Unicode 0641) seems to get corrupted when entered in a table, -- while all the other Arabic letters I used were OK. use test; tee outfile.txt; drop table if exists ALetters; create table ALetters ( letter VARCHAR(2) CHARACTER SET UTF8, name VARCHAR(5) CHARACTER SET UTF8); -- entering 3 different letters for comparison: INSERT INTO ALetters VALUES ('ب','ba'),('ف','fa'),('ك','kaf'); SELECT * FROM ALetters; -- seems OK so far, BUT the letter 'fa' is incorrectly rendered in the table (column letter), -- It comes out as a ? in the outfile.txt (if the textfile is encoded as utf8), and -- on my html page using perl/CGI/DBI it is displayed as another letter (Tehe: ٿ, Unicode 067F)? -- But the letter comes out correctly when using the following statements: select hex('ف'); select unhex('d981'); select unhex(hex('ف')); -- select unhex(hex('ب')); -- select unhex(hex('ف')); -- select unhex(hex('ك')); -- BUT when using the same statement with values from the table, -- the letter 'fa' is of course corrupted as before: INSERT INTO ALetters select unhex(hex(letter)), name from Aletters; SELECT * FROM ALetters; -- WHY is the letter 'fa' corrupted? How do I put it right?