doddsey_65 Posted August 10, 2011 Share Posted August 10, 2011 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"> Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/ Share on other sites More sharing options...
phpSensei Posted August 10, 2011 Share Posted August 10, 2011 Did you have this? I believe its required, not too sure since I rarely work with special characters such as 'é' I am french though! <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/#findComment-1255140 Share on other sites More sharing options...
doddsey_65 Posted August 10, 2011 Author Share Posted August 10, 2011 yes i have also included: <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/#findComment-1255145 Share on other sites More sharing options...
anups Posted August 10, 2011 Share Posted August 10, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/#findComment-1255150 Share on other sites More sharing options...
Jumpy09 Posted August 10, 2011 Share Posted August 10, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/#findComment-1255153 Share on other sites More sharing options...
doddsey_65 Posted August 10, 2011 Author Share Posted August 10, 2011 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"> Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/#findComment-1255155 Share on other sites More sharing options...
Morg. Posted August 10, 2011 Share Posted August 10, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/244373-character-encoding/#findComment-1255276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.