[Freeipa-users] What does the "u" mean in IPA messages?
John Dennis
jdennis at redhat.com
Thu Feb 28 21:27:25 UTC 2013
On 02/28/2013 04:18 PM, KodaK wrote:
> When performing an operation with the IPA tools, I get a message every
> time similar to this:
>
> ipa: INFO: Forwarding 'hbactest' to server u'https://ipaserver/ipa/xml'
>
> What does it mean? I've never seen it say anything other than "u"
> (that I've noticed.) A pointer to documentation is preferred, but
> I've been looking and haven't found anything. (Lots of stuff on the
> International Phonetic Alphabet's use of "u" though. I think I'm
> qualified to edit dictionaries now.)
It means unicode, It's a Python'ism. In Python2 there are two different
string types str and unicode. str's are have 8-bit characters, unicode
have wide characters (either 16-bit UCS2 or 32-bit UCS4) depending on
how Python was built (unicode is UCS4 on our builds). Since IPA in
internationalized we use unicode for all strings.
What the u prefix is telling you is the type of the string. The only
reason you see it is because in some places we use the repr method to
output string data and the repr method prefixes unicode with a u
character. We've been fixing places where repr method is used, not sure
if this is one of those or not. We were using repr because early on we
were not consistent with whether we used str's or unicode objects and it
was handy to know the difference, it's not so much of an issue any more.
--
John Dennis <jdennis at redhat.com>
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
More information about the Freeipa-users
mailing list