[Dev] CPIA Layer having issues handling unicode strings
Brian Kirsch
bkirsch at osafoundation.org
Tue Jan 25 14:07:24 PST 2005
Hello Folks,
As a prelude to the forth coming "Internationalizing The Chandler
Architecture" proposal I will be sending out for review later this week
I
have gone ahead and added internationalization / localization support
to the Email Service Layer. In addition to properly parsing and storing
attachments the Service layer will convert all headers, bodies, and
text attachments to Unicode with the proper character set encoding as
specified in
RFC's 2046, 2047, and 2231. I have added two additional menu items
under "Test". The first "Mime Torture Tests" loads in to Chandler 76
real world complex / broken
mime message examples donated by Anthony Baxter. The second "i18n Mail
Tests" loads mime message examples in to Chandler that contain a
variety of
Charsets and Languages.
I have not checked in this code however, because the CPIA layer is
currently casting many objects to ASCII strings which causes runtime
UnicodeDecodeError's.
Can someone in the CPIA GUI team take on the responsibility of going
through the UI code and accounting for Unicode strings?
Here is stack trace of some of the errors I am encountering:
Traceback (most recent call last):
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/blocks/
ControlBlocks.py", line 721, in Draw
self.delegate.Draw (dc, rect, item, attributeName, isSelected)
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/attributeEditors/
AttributeEditors.py", line 164, in Draw
for line in str (string).split (os.linesep):
UnicodeEncodeError: 'ascii' codec can't encode characters in position
20-31: ordinal not in range(128)
Traceback (most recent call last):
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/blocks/
ControlBlocks.py", line 987, in OnExpanding
self.LoadChildren(event.GetItem())
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/blocks/
ControlBlocks.py", line 998, in LoadChildren
cellValues = self.GetElementValues (child)
File
"/OSAF/Chandler/chandler/parcels/osaf/views/repositoryviewer/
Repository.py", line 29, in GetElementValues
cellValues.append (str (element.getItemDisplayName()))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u516d' in
position 2: ordinal not in range(128)
Traceback (most recent call last):
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/blocks/
ControlBlocks.py", line 1018, in OnCollapsing
del self.blockItem.openedContainers [self.GetItemData(id).GetData()]
File
"/OSAF/Chandler/chandler/repository/item/PersistentCollections.py",
line 318, in __delitem__
super(PersistentDict, self).__delitem__(key)
KeyError: <UUID: c3a21278-6f1a-11d9-984c-000a95ca1ecc>
Traceback (most recent call last):
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/blocks/
ControlBlocks.py", line 987, in OnExpanding
self.LoadChildren(event.GetItem())
File
"/OSAF/Chandler/chandler/parcels/osaf/framework/blocks/
ControlBlocks.py", line 998, in LoadChildren
cellValues = self.GetElementValues (child)
File
"/OSAF/Chandler/chandler/parcels/osaf/views/repositoryviewer/
Repository.py", line 29, in GetElementValues
cellValues.append (str (element.getItemDisplayName()))
Thanks,
Brian Kirsch - Email Framework Engineer
Open Source Applications Foundation
543 Howard St. 5th Floor
San Francisco, CA 94105
(415) 946-3056
http://www.osafoundation.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3417 bytes
Desc: not available
Url : http://lists.osafoundation.org/pipermail/dev/attachments/20050125/655737be/attachment.bin
More information about the Dev
mailing list