[Zope-DB] Vietnamese charater displayed not correctly!

Andreas Jung lists at zopyx.com
Thu Aug 10 00:36:05 EDT 2006



--On 10. August 2006 06:31:04 +0200 Andreas Jung <lists at zopyx.com> wrote:

>
>
> --On 10. August 2006 10:04:58 +0700 NGUYEN HUU DINH
> <DINHNH.EVNIT at evn.com.vn> wrote:
>
>> Hi,
>>
>> I used mxodbc connected to MSSQL Server to get vietnamese data and
>> displayed it in portlets. But vietnamese characters displayed not
>> correctly, question mark appeared!!! I've set the encoding to utf-8 but I
>> don't know why.
>
> Which encoding?
>
> *You* must ensure that you receive your data from database as Python
> Unicode strings or UTF-8. If your database encoding is XXXX you *can't*
> expect that the data will be shown correctly.
>

In addition you must ensure that the HTML page is sent out with a 
content-type: text/html; charset=utf-8 HTTP header. You 
RESPONSE.setHeader() to set the header.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-db/attachments/20060810/b7df6209/attachment.bin


More information about the Zope-DB mailing list