#NEWLINE# @ staticmethod #NEWLINE# def cf_string_to_unicode( value ) : #NEWLINE# #INDENT# '\n        Creates a python unicode string from a CFString object\n\n        :param value:\n            The CFString to convert\n\n        :return:\n            A python unicode string\n        ' #NEWLINE# string_ptr = CoreFoundation . CFStringGetCStringPtr ( result , kCFStringEncodingUTF8 ) #NEWLINE# string = ffi . string ( string_ptr ) #NEWLINE# if ( string is None ) : #NEWLINE# #INDENT# buffer = buffer_from_bytes ( 1024 ) #NEWLINE# result = CoreFoundation . CFStringGetCString ( value , buffer , 1024 , kCFStringEncodingUTF8 ) #NEWLINE# if ( not result ) : #NEWLINE# #INDENT# raise OSError ( 'Error copying C string from CFStringRef' ) #NEWLINE# #UNINDENT# string = byte_string_from_buffer ( buffer ) #NEWLINE# #UNINDENT# if ( string is not None ) : #NEWLINE# #INDENT# string = string . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# return string