mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:14:58 +00:00
AK: Add UnicodeUtils with Unicode-related helper functions
This introduces the UnicodeUtils file, which contains helper functions related to Unicode. This is in contrast to StringUtils, whose functions are not directly related to Unicode and are, in theory, encoding-agnostic.
This commit is contained in:
parent
621a4008e6
commit
3c2565da94
2 changed files with 57 additions and 0 deletions
20
AK/UnicodeUtils.h
Normal file
20
AK/UnicodeUtils.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
|
||||
namespace AK::UnicodeUtils {
|
||||
|
||||
constexpr bool is_unicode_control_code_point(u32 code_point)
|
||||
{
|
||||
return code_point < 0x20 || (code_point >= 0x80 && code_point < 0xa0);
|
||||
}
|
||||
|
||||
Optional<StringView> get_unicode_control_code_point_alias(u32);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue