To understand, how the browser, web-server, db-server handles char-set encoding and how the final document which produces to the browser complies with the char-set which developer specifies at the top of the web page, Please look in to the following example.
There's a dynamic web page. When a browser requests the page, web-server/PHP loads some content from a MySQL database and integrate in to the page. In the MySQL DB, the collation (char-set) is latin1_swedish_ci
.
In the web page the char-set is specified as "UTF-8 (<meta charset="utf-8">
)
1) The final processed web page contains characters from both encodings?
2) Or web-server/PHP converting latin1_swedish_ci
text in to UTF-8
?
3) If the web page is anyhow encoded to UTF-8
when sending to browser,
There can be a possible doubt whether the latin1_swedish_ci
has converted correctly. (in some situations, I've seen "?" for badly encoded characters)
4) If this is a buggy situation, what is the best approach to minimize the damage?