[Freeipa-devel] python-ldap has unicode issues

Kevin McCarthy kmccarth at redhat.com
Fri Aug 17 23:13:14 UTC 2007


John Dennis wrote:
> The issue really turns on what external libraries are expecting. If all
> the libraries are UTF-8 you're golden.
>
> In general you never want to use Python's unicode strings, instead
> encode everything in UTF-8 and continue to use the standard 8-bit Python
> 'str' strings.

Okay, this matches what I'm finding.  Glad to hear that's the issue.

Right now Turbo Gears seems to be returning unicode strings for all
parameters passed in.  Running them through the encode('utf-8') does
what you mention and does seem to do the trick.

> If you're using GNU gettext and are binding the function _() you need to
> tell gettext to return UTF-8, not unicode.

Maybe the cli tools will need to do this.

> I'm trying to wrap up for the day now so I'm being brief, but on Monday
> I can work with you to solve these issues, dig up my documentation, etc.

Thanks, your experience is appreciated and welcome.

-Kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070817/cb8d1f57/attachment.bin>


More information about the Freeipa-devel mailing list