Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -1875,18 +1875,16 @@ { OFObject *object = [[[OFObject alloc] init] autorelease]; of_unichar_t *ret; size_t i, j; - ret = [object allocMemoryForNItems: s->length + 2 + ret = [object allocMemoryForNItems: s->length + 1 ofSize: sizeof(of_unichar_t)]; i = 0; j = 0; - ret[j++] = 0xFEFF; - while (i < s->cStringLength) { of_unichar_t c; size_t cLen; cLen = of_string_utf8_to_unicode(s->cString + i, Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -379,11 +379,11 @@ [@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" @"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" hexadecimalValue]) TEST(@"-[unicodeString]", (ua = [@"fööbär🀺" unicodeString]) && - !memcmp(ua, ucstr, 9 * sizeof(of_unichar_t))) + !memcmp(ua, ucstr + 1, sizeof(ucstr) - sizeof(of_unichar_t))) TEST(@"-[MD5Hash]", [[@"asdfoobar" MD5Hash] isEqual: @"184dce2ec49b5422c7cfd8728864db4c"]) TEST(@"-[SHA1Hash]", [[@"asdfoobar" SHA1Hash]