Question: HI
I have the following (apparently simple) problem: I have to install a simple website, made by someone else, on a web hosting account. The site consists of lot and lot of HTML pages, no dynamic content, created some in MS Word and saved as html, some in frontpage, etc. A mixed bag. 

I uploaded initially on a test account on my server (Win Server 2003) and it works ok.
Then I uploaded on the real web hosting (fedora / apache).
When I loaded the site in browser I see lot of odd craracters (instead of diacritics, used in html pages). Duacritics were saved as escape code, like & #350; for Ș (using codepage 1252).

The problem is, when I load the page from my own test server, the browser select automatically correct codepage (1252).

But when I load the site from public host, the same bowser loads the page using utf-8 encoding, rendering page with odd caracrets.

The test site on my server can be seen at <http://radu-stanian.dnsalias.com> and on public server at <http://radustanian.scoli.edu.ro/>

This happens no matter what browser I use (IE, ff or chrome)

What should I do to force browsers to load the pages in correct codepage?

Making changes to every page is not an option, because there are hundreds of pages, created by various peoples which could edit them further for update

Thank you

Answer: 
You don't give enough information to confirm this, but I guess the salt is used in its binary form. In that case, changing the encoding of the file will corrupt the salt if this binary stream is changed, even if the characters are correctly converted.

Since the first 128 characters are similar in UTF-8 and Mac OS Roman, you don't have to worry if the salt is written using only these characters.

Let's say the salt is somewhere:

```
$salt = "a!c‡Œ";

```

You could write instead:

```
$salt = "a!c\xE0\xCE";

```

You could map all to their hexadecimal representation, as it might be easier to automate:

```
$salt = "\x61\x21\x63\xE0\xCE";

```

See the table [here](http://en.wikipedia.org/wiki/MacRoman).

The following snippet can automate this conversion:

```
$res = "";
foreach (str_split($salt) as $c) {
    $res .= "\\x".dechex(ord($c));
}
echo $res;

```
Have you tried [mb-convert-encoding](http://php.net/manual/en/function.mb-convert-encoding.php) ?

Think it would be:

```
$str = mb_convert_encoding($str, "macintosh", "UTF-8");

```