views:

44

answers:

1

As explained here (http://stackoverflow.com/questions/2867771/php-include-and-accents-they-show-up-as) php has a strange behavior processing the accents. My question is Why?

I mean: I have a simple utf-8 charset page. With this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
  <title>My Title</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
  <?php include ('file.php');?> 

The included file just says: "Administración." It has no charset, just header tags (h2, h3...), and some links. Like this:

<h2>Administración</h2>

So, there is no charset conflict. Are not they supposed that the include files are just included?

The previous question was answered with some fix to the problem, but my question is Why PHP behaves this way?

A: 

to answer you new questions (from your comment):

How can I do the same thing in other editors, how do I know the default charset?

default-charset and charset for every single file can be set in almost every code-editor i know - where exactly depends on the editor. simply take a look into the manual/documentation of your editor for that.

oezi
oezi: That´s seems to be right. Working in NotPad++ I see that it has an option of Encoding, I think is a matter of been aware of matching encodings between documents. (And working with editors that let you set the correct option) Thanks for your help.
Edgar