spotlightsnap
spotlightsnap

Reputation: 1113

How to remove  character

I got very strange problem. I have one php website which is running in two server. One is on Apache (Linux) and second is on IIS (WIndow). Linux Server, I just run it for demo. IIS is the actual hosting that I need to host. Even with all the same code, database, in the linux server, there's no  character. But in IIS, everywhere got  characters. I checked all the meta tag, it's utf-8. In database collation is utf-8 also. In mysql database, i got those  character, but somehow, in linux, when we fetch the content from database, those  doesn't show. It just happening on IIS. Can anyone point out how can i resolve this ? Thank you.

Upvotes: 5

Views: 15621

Answers (4)

troelskn
troelskn

Reputation: 117517

I checked all the meta tag, it's utf-8.

The browser doesn't interpret the meta tag. It's only a fallback when no http-headers are present. Right click and select "View Page Info" to see what encoding the browser actually interprets the page in.

In database collation is utf-8 also. In mysql database

Collation is irrelevant for display of characters. The charset matters however. So does the connection charset.

Upvotes: 1

Vince Bowdren
Vince Bowdren

Reputation: 9208

Try inspecting the html responses directly by using something like Fiddler or Firebug. Check to see if the responses from IIS/Apache (which should be returning exactly the same text) have:

  • Different data
  • Different headers

Pay particular attention to the Content-Type header, which should say what character encoding (utf-8, ISO/IEC 8859-1, Latin-1, etc.) the returned text is in.

Upvotes: 0

Álvaro González
Álvaro González

Reputation: 146460

You also need to specify UTF-8 in the HTTP headers. With PHP:

<?php
header('Content-Type: text/plain; charset=utf-8');
?>

With Apache:

AddDefaultCharset UTF-8

The Apache setting can be placed in an .htaccess file.

Upvotes: 2

suitedupgeek
suitedupgeek

Reputation: 885

I had a similar issue a while ago, there are some useful comments and information here - it's PHP but I believe the theory would be the same:Question 386378

Upvotes: 2

Related Questions