1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
|
}
return value;
}
- (of_unichar_t*)unicodeString
{
of_unichar_t *ret;
size_t i, j, len;
len = [self length];
if ((ret = malloc((len + 1) * sizeof(of_unichar_t))) == NULL)
@throw [OFOutOfMemoryException newWithClass: isa];
i = j = 0;
while (i < length) {
of_unichar_t c;
size_t cLen;
cLen = of_string_utf8_to_unicode(string + i, length - i, &c);
|
>
|
|
>
<
<
>
>
|
|
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
|
}
return value;
}
- (of_unichar_t*)unicodeString
{
OFObject *object = [[[OFObject alloc] init] autorelease];
of_unichar_t *ret;
size_t i, j;
ret = [object allocMemoryForNItems: [self length] + 2
withSize: sizeof(of_unichar_t)];
i = 0;
j = 0;
ret[j++] = 0xFEFF;
while (i < length) {
of_unichar_t c;
size_t cLen;
cLen = of_string_utf8_to_unicode(string + i, length - i, &c);
|