Forum Moderators: coopster & phranque

Message Too Old, No Replies

Accented characters in MySQL

         

transistor

1:47 am on May 22, 2002 (gmt 0)

10+ Year Member



Well, I'm not sure if this is the appropiate forum, so just let me know if it is moved.
Ok, if I insert data from a form with accented characters, they are stored and retrieved ok.
e.g.: insert into bla (name) values ('blá')
$name = mysql_result($result,0,"name");
echo htmlentities($name)
-> blá
so far, so good.
BUT, if I use LOAD DATA INFILE the accented characters, the ñ (and I guess others like åö, etc.) turn into strange characters, so I have to manually edit each record, changing back these characters.
I've tried writing a simple PHP script that would replace the strange chars. to the ones I want, but no use.
Same thing happens if I execute a text file containing individual inserts for each record:
insert into bla (name) values ('blá');
insert into bla (name) values ('blå');
insert into bla (name) values ('blä');
Any ideas, experiences, hints? thank you!

OpenBSD 3.0+Apache 1.3.19+MySQL 3.23.32+PHP 4.0.6

DrDoc

11:07 pm on May 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What kind of 'strange characters' do you get?