If the Content-Type header is present in the headers of the HTTP response, then this will override the metadata headers. Very often, this header is already provided by default by the web server, and most often the encoding is missing (which will assume the default encoding for the client, which is often ISO-8859-1). In other words, metadata headers are usually interpreted only when resources are opened locally (rather than HTTP). Most likely, this is the reason your meta headers did not seem to work when transmitted over HTTP.
You can use Firebug or Fiddler2 to define HTTP response headers. The following is the Firebug screen:

You can configure general settings for HTTP response headers at the web server level. You can also customize it based on a query at the programming language level. Since it is unclear which web server / programming language you are using, I cannot explain in detail how to configure it.
Update : according to the symptoms of the problem, which are the following typical MySQL exception:
java.sql.SQLException: Incorrect string value: '\xD8\xB3\xD9\x84\xD8\xA8...'
The byte sequence D8 B3 D9 84 D8 A8 is a valid UTF-8 sequence that represents those Ψ³ΩΨ¨ characters ( U + 0633 , U + 0644 and U + 0628 ). So the HTTP part is fine. You mentioned that you are using Jetty 6 as a servletcontainer. Later Jetty 6 builds already support UTF-8 out of the box.
However, the problem lies in the DB part. This exception indicates that the encoding that DB / table was instructed to use does not support this byte sequence. This can happen when DB / table has not been instructed to use UTF-8.
To fix part of the database, execute these MySQL commands:
ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
And for future DB / tables, use CHARACTER SET utf8 COLLATE utf8_general_ci in CREATE .
Balusc
source share