[Pyobjc-dev] Unicode-like objects
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-02-04 19:05:47
|
In response to my query on c.l.py, Michael Hudson came up with this example: >>> re.match('(a)|b', array.array('u', u'a string')).groups() (array('u', u'a'),) So apparently there is some sort of unicode buffer interface. Yet I believe this can only work if the internal layout of the bytes match that of a real unicode object. Could that be made the case for NSString? Additional potential problem: for string-like objects to work interchangably with real strings, they must hash equally when they compare equally. The Python unicode implementation apparently had to go through quite a bit of trouble to make this true between (7-bit) 'str' instances and 'unicode' instances. Just |