[silva-dev] Special Characters in Content from MySQL Database

Bengt Giger bengt.giger at id.ethz.ch
Fri Jun 16 14:20:24 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martijn Faassen wrote:

> context.REQUEST.RESPONSE.setHeader('Content-Type',
> 'text/html;charset=utf-8')
> 
> that will tell the browser that pages are indeed delivered as UTF-8.

I think the pages are correctly marked as utf-8, otherwise you would see
double byte characters. Question marks apper if you have unknown characters in
a unicode text; i.e. iso-8859 umlauts.

We used this method often during a migration from Silva 0.9 (8-bit based) to
Silva 1.1:

  unicode_text = db_output.decode('iso-8859-1').encode('utf-8')

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBRJKiCBxwykL/U8y3AQLAXgf/USQxD3OPOdOXaGPX0owup0rMvo62U6GE
i0PrBW3mnoHTyz4+FfSfR8T1fJHMVKEL+CjSFXLa3K2oa0JWxrpIGmHRzYWIbIqq
KsQI/N+jG7NKZVuauEjY+g6yKebf2uM7ppIn0jwDjcKBB9rdkig598zo0MWiF8OW
sPPMwS60hQ2xICK4AFxhyslK4WrY51Z1/rF5u6VC777F1X34FUs+an4NB1Er80Xd
RA9I3OdnSulAuAtEcmgKO0bxg65h1nI2N4uadoziLnG918o3nIoLfM0vHbX2wIP3
sQ+a49//2cZ9cPdG7DIGlwntBGqeX+E/112rwc0aQtSd7l6FWTKogA==
=waoS
-----END PGP SIGNATURE-----



More information about the silva-dev mailing list