Character set issue? Character renders funny

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Character set issue? Character renders funny

Post by alex.barylski »

I have a large database of Canadian businesses some of the names are french.

Example: 1003 Rue Du March�-Central

On my screen and in the TEXTAREA for writing this it appears March[]

Where [] is a little box -- when while in phpMyAdmin the character appears correct and is an accented 'e'

What am I, phpBB doing wrong and phpMyAdmin doing right? Do I have to set the character set using HTML or is it done using header() or something similar?

Is this even a character set issue?

Cheers,
Alex
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Character set issue? Character renders funny

Post by onion2k »

You need to set the character set to the correct encoding for the mysql client (PHP in this case). Use..

Code: Select all

mysql_query("SET NAMES utf8", $databaseLink);
Where the function is whatever you're using to execute queries, 'utf8' is the correct encoding, and $databaseLink is the db connection. You may also need to set the encoding of the page to the correct value too, either with a header() or a meta tag.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Character set issue? Character renders funny

Post by alex.barylski »

Whats weird, is that it worked fine in Firefox, Opera, etc...just not IE7...

However when I added the following line to the .htaccess file everything worked fine:

Code: Select all

AddDefaultCharset iso-8859-1
When I specify utf-8 however those little blocks show up again... :banghead:

It works but it's annoying...not sure whats going on...
l.francis30
Forum Newbie
Posts: 12
Joined: Tue May 19, 2009 11:27 am

Re: Character set issue? Character renders funny

Post by l.francis30 »

PCSpectra wrote:Whats weird, is that it worked fine in Firefox, Opera, etc...just not IE7...

However when I added the following line to the .htaccess file everything worked fine:

Code: Select all

AddDefaultCharset iso-8859-1
When I specify utf-8 however those little blocks show up again... :banghead:

It works but it's annoying...not sure whats going on...
This thing also happen to me before but i still can find a way to solve it until now.. It have connection with character set installed in windows? because IE is also microsoft product.. Maybe you don't have french character set in your windows OS
Post Reply