| 
									
										
										
										
											2022-10-02 22:57:22 -03:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2022, mat | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-08 11:05:51 -05:00
										 |  |  | #include <AK/Error.h>
 | 
					
						
							| 
									
										
										
										
											2022-10-02 22:57:22 -03:00
										 |  |  | #include <AK/Forward.h>
 | 
					
						
							|  |  |  | #include <AK/Optional.h>
 | 
					
						
							|  |  |  | #include <AK/Span.h>
 | 
					
						
							| 
									
										
										
										
											2023-01-14 09:52:38 -05:00
										 |  |  | #include <AK/String.h>
 | 
					
						
							| 
									
										
										
										
											2022-10-02 22:57:22 -03:00
										 |  |  | #include <AK/StringView.h>
 | 
					
						
							|  |  |  | #include <LibUnicode/Forward.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Unicode { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-06 07:08:56 +01:00
										 |  |  | Optional<CodePointDecomposition const> code_point_decomposition(u32 code_point); | 
					
						
							|  |  |  | Optional<CodePointDecomposition const> code_point_decomposition_by_index(size_t index); | 
					
						
							| 
									
										
										
										
											2022-10-02 22:57:22 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | enum class NormalizationForm { | 
					
						
							|  |  |  |     NFD, | 
					
						
							|  |  |  |     NFC, | 
					
						
							|  |  |  |     NFKD, | 
					
						
							|  |  |  |     NFKC | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-06 10:45:59 -04:00
										 |  |  | NormalizationForm normalization_form_from_string(StringView form); | 
					
						
							|  |  |  | StringView normalization_form_to_string(NormalizationForm form); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-14 09:52:38 -05:00
										 |  |  | ErrorOr<String> normalize(StringView string, NormalizationForm form); | 
					
						
							| 
									
										
										
										
											2022-10-02 22:57:22 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |