Jump to content

Somethings wrong with my Charset


Niixie

Recommended Posts

Hey PHPFreaks!

 

I have some problems with the charset on my site, i don't know if it's the MySQL databases charset or the webpages charset thats wrong, my bet is the database.

 

When i see the text on the page, it loads like this;

Dell b�rbar
S�lger min Dell, da jeg har k�bt en anden

(EDIT: The &#######; is the questionmarks)

 

The questionmarks was supposed to be either 'æ', 'ø', or 'å', but when i write in the PHP document, under the MySQL processed text, it's all fine?

 

How can i change the charset on the MySQL database, so it's alright for special danish characters?

 

Thanks in advance

Niixie

Link to comment
Share on other sites

ALTER DATABASE xxxx CHARACTER SET utf8 COLLATE utf8_danish_ci;

 

Should get you on utf-8.. Now you do have to make sure that all your files are also utf-8 and you send the proper headers for the browser telling you prefer utf-8.. Remember to define charset at your html head with meta tag.. When you get input, check the content-type header also to make sure the browser is sending utf-8 back. Some browsers won't tell you the type but then you just have to rely on the right behavior. If you're getting wrong charset; use iconv to convert the data to utf-8. You need to know what you're converting and the only way to know it is if the browser tells you what charset it is sending...

 

All and all that's the basics of making sure you always have the right charset.

Link to comment
Share on other sites

I set all tables in the database to utf8_danish_ci, manually, still nothing.

 

I have this in all the pages that has the <head> tags;

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

Nothings wrong there, as i can see?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.