@@ -254,11 +254,11 @@ s->cStringLength = UTF8StringLength; switch (of_string_utf8_check(UTF8String, UTF8StringLength, &s->length)) { case 1: - s->UTF8 = YES; + s->isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; } @@ -301,11 +301,11 @@ case 1: if (encoding == OF_STRING_ENCODING_ASCII) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; - s->UTF8 = YES; + s->isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; } @@ -327,11 +327,11 @@ if (!(cString[i] & 0x80)) { s->cString[j++] = cString[i]; continue; } - s->UTF8 = YES; + s->isUTF8 = YES; bytes = of_string_utf8_encode( (uint8_t)cString[i], buffer); if (bytes == 0) @throw [OFInvalidEncodingException @@ -377,11 +377,11 @@ if (character == 0xFFFD) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; - s->UTF8 = YES; + s->isUTF8 = YES; characterBytes = of_string_utf8_encode(character, buffer); if (characterBytes == 0) @throw [OFInvalidEncodingException @@ -427,11 +427,11 @@ s->cStringLength = UTF8StringLength; switch (of_string_utf8_check(UTF8String, UTF8StringLength, &s->length)) { case 1: - s->UTF8 = YES; + s->isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; } @@ -452,13 +452,13 @@ s->cStringLength = [string UTF8StringLength]; if ([string isKindOfClass: [OFString_UTF8 class]] || [string isKindOfClass: [OFMutableString_UTF8 class]]) - s->UTF8 = ((OFString_UTF8*)string)->s->UTF8; + s->isUTF8 = ((OFString_UTF8*)string)->s->isUTF8; else - s->UTF8 = YES; + s->isUTF8 = YES; s->length = [string length]; s->cString = [self allocMemoryWithSize: s->cStringLength + 1]; memcpy(s->cString, [string UTF8String], s->cStringLength + 1); @@ -505,27 +505,27 @@ switch (characterLen) { case 1: s->cString[j++] = buffer[0]; break; case 2: - s->UTF8 = YES; + s->isUTF8 = YES; s->cStringLength++; memcpy(s->cString + j, buffer, 2); j += 2; break; case 3: - s->UTF8 = YES; + s->isUTF8 = YES; s->cStringLength += 2; memcpy(s->cString + j, buffer, 3); j += 3; break; case 4: - s->UTF8 = YES; + s->isUTF8 = YES; s->cStringLength += 3; memcpy(s->cString + j, buffer, 4); j += 4; @@ -612,27 +612,27 @@ switch (characterLen) { case 1: s->cString[j++] = buffer[0]; break; case 2: - s->UTF8 = YES; + s->isUTF8 = YES; s->cStringLength++; memcpy(s->cString + j, buffer, 2); j += 2; break; case 3: - s->UTF8 = YES; + s->isUTF8 = YES; s->cStringLength += 2; memcpy(s->cString + j, buffer, 3); j += 3; break; case 4: - s->UTF8 = YES; + s->isUTF8 = YES; s->cStringLength += 3; memcpy(s->cString + j, buffer, 4); j += 4; @@ -684,11 +684,11 @@ @try { switch (of_string_utf8_check(tmp, cStringLength, &s->length)) { case 1: - s->UTF8 = YES; + s->isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; } @@ -722,13 +722,13 @@ s->cStringLength = [firstComponent UTF8StringLength]; if ([firstComponent isKindOfClass: [OFString_UTF8 class]] || [firstComponent isKindOfClass: [OFMutableString_UTF8 class]]) - s->UTF8 = ((OFString_UTF8*)firstComponent)->s->UTF8; + s->isUTF8 = ((OFString_UTF8*)firstComponent)->s->isUTF8; else - s->UTF8 = YES; + s->isUTF8 = YES; s->length = [firstComponent length]; /* Calculate length and see if we need UTF-8 */ va_copy(argumentsCopy, arguments); @@ -737,13 +737,14 @@ s->length += 1 + [component length]; if ([component isKindOfClass: [OFString_UTF8 class]] || [component isKindOfClass: [OFMutableString_UTF8 class]]) - s->UTF8 = ((OFString_UTF8*)component)->s->UTF8; + s->isUTF8 = + ((OFString_UTF8*)component)->s->isUTF8; else - s->UTF8 = YES; + s->isUTF8 = YES; } s->cString = [self allocMemoryWithSize: s->cStringLength + 1]; cStringLength = [firstComponent UTF8StringLength]; @@ -786,11 +787,11 @@ { switch (encoding) { case OF_STRING_ENCODING_UTF_8: return s->cString; case OF_STRING_ENCODING_ASCII: - if (s->UTF8) + if (s->isUTF8) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; return s->cString; default: @@ -814,11 +815,11 @@ { switch (encoding) { case OF_STRING_ENCODING_UTF_8: return s->cStringLength; case OF_STRING_ENCODING_ASCII: - if (s->UTF8) + if (s->isUTF8) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; return s->cStringLength; default: @@ -899,11 +900,11 @@ selector: _cmd]; otherCString = [otherString UTF8String]; otherCStringLength = [otherString UTF8StringLength]; - if (!s->UTF8) { + if (!s->isUTF8) { minimumCStringLength = (s->cStringLength > otherCStringLength ? otherCStringLength : s->cStringLength); if ((compare = memcasecmp(s->cString, otherCString, minimumCStringLength)) == 0) { @@ -1007,11 +1008,11 @@ of_unichar_t character; if (index >= s->length) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; - if (!s->UTF8) + if (!s->isUTF8) return s->cString[index]; index = of_string_utf8_get_position(s->cString, index, s->cStringLength); @@ -1094,11 +1095,11 @@ size_t end = range.start + range.length; if (end > s->length) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; - if (s->UTF8) { + if (s->isUTF8) { start = of_string_utf8_get_position(s->cString, start, s->cStringLength); end = of_string_utf8_get_position(s->cString, end, s->cStringLength); }