Re: Unicode and UTF-8
Gerold Penz <[email protected]>
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
Jean-Baptiste Quenot schrieb:
> Interesting usecase.
Hello Jean-Baptiste!
Thank you, for your efforts!
My real usecase is: Translating the templates with "gettext".
Here's an example:
#!/usr/bin/env python
#coding: utf-8
import gettext
from Cheetah.Template import Template
source = """#encoding utf-8
$_(u"Österreich.")
"""
template = Template(source = source)
template._ = gettext.translation(
"testdomain", fallback = True
).ugettext
print repr(template.respond())
# --> u'\xc3\x96sterreich\n'
# Shouldn't it be: u'\xd6sterreich\n'?
Regards,
Gerold
:-)
--
Waldhart Software
A-6405 Pfaffenhofen, Unterdorf 145
Tel: +43 5262 64574, Fax: +43 5262 64514
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects