mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-05 23:35:33 +00:00
LibUnicode: Return a String from Unicode normalization
This commit is contained in:
committed by
Linus Groh
parent
c9056b824e
commit
58bc831750
@@ -302,7 +302,7 @@ static ErrorOr<Vector<u32>> normalize_implementation(Utf8View string, Normalizat
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
ErrorOr<DeprecatedString> normalize(StringView string, NormalizationForm form)
|
||||
ErrorOr<String> normalize(StringView string, NormalizationForm form)
|
||||
{
|
||||
auto const code_points = TRY(normalize_implementation(Utf8View { string }, form));
|
||||
|
||||
@@ -310,7 +310,7 @@ ErrorOr<DeprecatedString> normalize(StringView string, NormalizationForm form)
|
||||
for (auto code_point : code_points)
|
||||
TRY(builder.try_append_code_point(code_point));
|
||||
|
||||
return builder.to_deprecated_string();
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibUnicode/Forward.h>
|
||||
|
||||
@@ -29,6 +29,6 @@ enum class NormalizationForm {
|
||||
NormalizationForm normalization_form_from_string(StringView form);
|
||||
StringView normalization_form_to_string(NormalizationForm form);
|
||||
|
||||
ErrorOr<DeprecatedString> normalize(StringView string, NormalizationForm form);
|
||||
ErrorOr<String> normalize(StringView string, NormalizationForm form);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user