mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-21 08:21:54 +00:00
This is a strictly UTF-16 string with some optimizations for ASCII.
* If created from a short UTF-8 or UTF-16 string that is also ASCII,
then the string is stored in an inlined byte buffer.
* If created with a long UTF-8 or UTF-16 string that is also ASCII,
then the string is stored in an outlined char buffer.
* If created with a short or long UTF-8 or UTF-16 string that is not
ASCII, then the string is stored in an outlined char16 buffer.
We do not store short non-ASCII text in the inlined buffer to avoid
confusion with operations such as `length_in_code_units` and
`code_unit_at`. For example, "😀" would be stored as 4 UTF-8 bytes
in short string form. But we still want `length_in_code_units` to
be 2, and `code_unit_at(0)` to be 0xD83D.
|
||
---|---|---|
.. | ||
CharacterTypes.cpp | ||
CharacterTypes.h | ||
CMakeLists.txt | ||
Collator.cpp | ||
Collator.h | ||
CurrencyCode.cpp | ||
CurrencyCode.h | ||
DateTimeFormat.cpp | ||
DateTimeFormat.h | ||
DisplayNames.cpp | ||
DisplayNames.h | ||
DurationFormat.cpp | ||
DurationFormat.h | ||
Forward.h | ||
ICU.cpp | ||
ICU.h | ||
IDNA.cpp | ||
IDNA.h | ||
ListFormat.cpp | ||
ListFormat.h | ||
Locale.cpp | ||
Locale.h | ||
Normalize.cpp | ||
Normalize.h | ||
NumberFormat.cpp | ||
NumberFormat.h | ||
PartitionRange.h | ||
PluralRules.cpp | ||
PluralRules.h | ||
RelativeTimeFormat.cpp | ||
RelativeTimeFormat.h | ||
Segmenter.cpp | ||
Segmenter.h | ||
String.cpp | ||
TimeZone.cpp | ||
TimeZone.h | ||
UnicodeKeywords.cpp | ||
UnicodeKeywords.h |