1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

String: Use string length during UTF8 conversion

This implementation is equivalent to JUCE 7.
This commit is contained in:
Tatsuya Shiozawa 2024-06-15 16:25:33 +09:00 committed by reuk
parent 4828bd886d
commit 131b838c65
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -2164,7 +2164,7 @@ String String::fromUTF8 (const char* const buffer, int bufferSizeBytes)
}
jassert (CharPointer_UTF8::isValidString (buffer, bufferSizeBytes));
return { CharPointer_UTF8 (buffer), (size_t) bufferSizeBytes };
return { CharPointer_UTF8 (buffer), CharPointer_UTF8 (buffer + bufferSizeBytes) };
}
#if __cpp_char8_t