[Zope-Coders] unicode question

Steve Alexander steve@cat-box.net
Fri, 05 Oct 2001 15:07:11 +0100


Thanks Andreas. That answers it for the ZCatalog package.

I'm also looking for a more general policy statement on Zope and Unicode.



Andreas Jung wrote:

> The ZCatalog is currently unable to handle Unicode strings
> because the default ZopeSplitter is unable to handle anything
> other than string objects. There is currently a 'ajung-unicode' 
> branch to address this problem. A prototype of a Splitter
> working with unicode strings is also available in this branch but
> not very much tested yet. Also the interaction with the ZCatalog
> is not tested yet. So I will address these problems.
> 
> Andreas
> ----- Original Message ----- 
> From: "Steve Alexander" <steve@cat-box.net>
> To: <zope-coders@zope.org>
> Sent: Friday, October 05, 2001 09:51
> Subject: [Zope-Coders] unicode question
> 
> 
> 
>>How much should we be supporting unicode in Zope at present?
>>
>>In some code I'm writing for the ZCatalog API, I want to see whether an 
>>argument is a string or a sequence.
>>
>>My first thought was to use:
>>
>>   if isinstance(names, types.StringType):
>>       names=(names,)
>>
>>However, this won't work if "names" happens to be a unicode string.
>>
>>So, should I add two if clauses?
>>
>>   if isinstance(names, types.StringType):
>>       names=(names,)
>>   if isinstance(names, types.UnicodeType):
>>       names=(names,)
>>
>>--
>>Steve Alexander