Jump to content

Character Encoding


doddsey_65

Recommended Posts

I have specified the use of utf-8 encoding using:

 

header('Content-type: text/html; charset=utf-8');

 

but when ever I try to print a foreign charcter like é i get a question mark in a diamond. Am i missing something? I have also set the language to french using

 

<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">

 

Link to comment
Share on other sites

Edit: Are you turning them into HTML Entities?  If you are storing them in a Database the default Character Set is latin1 or what I believe is ISO-8859-1, if you turn them into entities before you store them it may actually display correctly.

 

This kind of fit my original post, but I think I was completely incorrect.

 

So question is are you storing the funky e as the funky e in a database or are you converting it to an entity?

Link to comment
Share on other sites

Just give a simple try it may help "use HTML5 standards"

 

<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>

 

if i were going towards html5 then i would need to use

 

<meta charset=UTF-8">

 

Link to comment
Share on other sites

UTF-8 is the best solution for encoding, however going full utf-8 is much more than just <meta>, you can find a lot about this on google, but few key points you might want to look into:

 

-> html utf-8 (meta)

-> php utf-8 (look at your script file encoding)

-> db utf-8 (look at your db encoding)

 

GL

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.