[Python-checkins] CVS: python/dist/src/Mac/Lib aepack.py,1.2,1.3

Jack Jansen jackjansen@users.sourceforge.net
Tue, 05 Feb 2002 13:24:49 -0800


Update of /cvsroot/python/python/dist/src/Mac/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv18852

Modified Files:
	aepack.py 
Log Message:
Added support for unicode strings (utxt).


Index: aepack.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aepack.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aepack.py	2001/08/25 12:00:49	1.2
--- aepack.py	2002/02/05 21:24:47	1.3
***************
*** 89,92 ****
--- 89,97 ----
  	if t == StringType:
  		return AE.AECreateDesc('TEXT', x)
+ 	if t == UnicodeType:
+ 		data = t.encode('utf16')
+ 		if data[:2] == '\xfe\xff':
+ 			data = data[2:]
+ 		return AE.AECreateDesc('utxt', data)
  	if t == ListType:
  		list = AE.AECreateList('', 0)
***************
*** 133,136 ****
--- 138,143 ----
  	if t == typeChar:
  		return desc.data
+ 	if t == typeUnicodeText:
+ 		return unicode(desc.data, 'utf16')
  	# typeColorTable coerced to typeAEList
  	# typeComp coerced to extended