0

I'm having some problems with accentuation and special characters on my website.

The problem only occurs on my webhosting (I've another website on the same hosting account, this one with the issue is in a sub folder, and the main website works well), on local with Wamp Server everything is OK.

So, my problem is: with .php extension accents aren't showed correctly but if I only change the file extension from .php to .html every accents are OK.


Edit:

I found my problem... I changed my code editor from notepad++ to sublime text and now it works.

It's strange because it was working well with wamp and in a free webhosting but not on my main hebhosting :/

Anyway, thank you very much for your help.

tjsf2011
  • 3
  • 3
  • Not sure what you need but have you tried using something like `header('Content-type: text/html; charset=utf-8');` in your PHP script? – Klemen Tusar Apr 15 '14 at 11:45
  • Hello, I've tried this solution but this didn't fix my problem :/ In effect, it's really strange. I've tried my page without any php script or whatever in php and change the file extension to .html and every characters are showed correctly. But, if I change again my file (my .html file) to .php, I've this problem :/ – tjsf2011 Apr 15 '14 at 11:50
  • Umm, can you paste that PHP file somewhere? – Klemen Tusar Apr 15 '14 at 11:51

2 Answers2

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

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

Note that, depending on where the text comes from, you might have to check some other things too (database-connection, source-file-encoding, ...) - i've listed a lot of them in one of my answers to a similar question.

In accordance with the similar issue Charset=utf8 not working in my PHP page

Community
  • 1
  • 1
Lucas Henrique
  • 1,380
  • 1
  • 11
  • 15
0

you need to use ASCII character

And is your content type correctly set?

I searched for you: you can use this: &eacute; (ascii 130)

eL-Prova
  • 1,084
  • 11
  • 27