Thread UTF-16 string input through JSON, script parsing, Date parsing, Intl option parsing, Temporal parsing, and the helper library boundaries that feed those parsers. Preserve ASCII fast paths where the source data is known to be ASCII.
30 lines
663 B
C++
30 lines
663 B
C++
/*
|
|
* Copyright (c) 2022, mat
|
|
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <AK/StringView.h>
|
|
#include <AK/Utf16String.h>
|
|
#include <AK/Utf16View.h>
|
|
|
|
namespace Unicode {
|
|
|
|
enum class NormalizationForm {
|
|
NFD,
|
|
NFC,
|
|
NFKD,
|
|
NFKC
|
|
};
|
|
NormalizationForm normalization_form_from_string(StringView);
|
|
NormalizationForm normalization_form_from_string(Utf16View);
|
|
StringView normalization_form_to_string(NormalizationForm);
|
|
|
|
String normalize(StringView string, NormalizationForm form);
|
|
Utf16String normalize(Utf16View string, NormalizationForm form);
|
|
|
|
}
|