summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Utf16String.cpp
AgeCommit message (Collapse)Author
2023-01-15LibJS: Define Utf16String::to_utf8 to convert Utf16String to StringTimothy Flynn
2023-01-15LibJS: Rename Utf16String::to_utf8 to to_deprecated_stringTimothy Flynn
2023-01-09AK+Everywhere: Rename Utf16View::to_utf8 to to_deprecated_stringTimothy Flynn
A subsequent commit will add to_utf8 back to create an AK::String.
2023-01-08LibJS+Everywhere: Make PrimitiveString and Utf16String fallibleTimothy Flynn
This makes construction of Utf16String fallible in OOM conditions. The immediate impact is that PrimitiveString must then be fallible as well, as it may either transcode UTF-8 to UTF-16, or create a UTF-16 string from ropes. There are a couple of places where it is very non-trivial to propagate the error further. A FIXME has been added to those locations.
2023-01-08AK+Everywhere: Make UTF-16 to UTF-8 converter fallibleTimothy Flynn
This could fail to allocate the underlying storage needed to store the UTF-8 data. Propagate this error.
2023-01-08AK+Everywhere: Make UTF-8 and UTF-32 to UTF-16 converters fallibleTimothy Flynn
These could fail to allocate the underlying storage needed to store the UTF-16 data. Propagate these errors.
2023-01-08AK+LibJS+LibRegex: Define an alias for UTF-16 string data storageTimothy Flynn
Instead of writing out "Vector<u16, 1>" everywhere, let's have a name for it.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-01-31Everywhere: Update copyrights with my new serenityos.org e-mail :^)Timothy Flynn
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-10-02LibJS+AK: Use Vector<u16, 1> for UTF-16 string storageAndreas Kling
It's very common to encounter single-character strings in JavaScript on the web. We can make such strings significantly lighter by having a 1-character inline capacity on the Vectors.
2021-08-10LibJS: Add a simple reference-counted UTF-16 stringTimothy Flynn
To help alleviate memory usage when creating and copying large strings, create a simple wrapper around a Vector<u16> to reference count UTF-16 strings.