src/core/c/pandalib.c
/*
 * Convert a UText to a panda String, closing the UText afterwards.
 */
Convert a UText to a panda String, closing the UText afterwards.
Convert a UText to a panda String closing the UText afterwards .
String* pandaUTextToString(UText* ut, int length) {
    const char* utf8 = (ut->context + (int) UTEXT_GETNATIVEINDEX(ut));
    String* result = pandaNewString(utf8, length);
    utext_close(ut);
    return result;
}
String * pandaUTextToString ( UText * ut , int length ) { const char * utf8 = ( ut -> context + ( int ) UTEXT_GETNATIVEINDEX ( ut ) ) ; String * result = pandaNewString ( utf8 , length ) ; utext_close ( ut ) ; return result ; }
Convert a UText to a panda String, closing the UText afterwards.
Convert a UText to a panda String closing the UText afterwards .
// NOTE: we are making the (usually unsafe) assumption that the UText // contains UTF-8 characters, so we can just do a straight copy out rather // than bother with conversion. As we are working exclusively in UTF-8, // this should always be true. 