Normalizer::getRawDecomposition

normalizer_get_raw_decomposition

(PHP 7 >= 7.3, PHP 8)

Normalizer::getRawDecomposition -- normalizer_get_raw_decompositionGets the Decomposition_Mapping property for the given UTF-8 encoded code point

Beschreibung

Objektorientierter Stil

public static Normalizer::getRawDecomposition(string $string, int $form = Normalizer::FORM_C): ?string

Prozeduraler Stil

normalizer_get_raw_decomposition(string $string, int $form = Normalizer::FORM_C): ?string

Gets the Decomposition_Mapping property, as specified in the Unicode Character Database (UCD), for the given UTF-8 encoded code point.

Parameter-Liste

string

The input string, which should be a single, UTF-8 encoded, code point.

Rückgabewerte

Returns a string containing the Decomposition_Mapping property, if present in the UCD.

Returns null if there is no Decomposition_Mapping property for the character.

Beispiele

Beispiel #1 Normalizer::getRawDecomposition() example

<?php

$result 
"";
$strings = [
    
"a",
    
"\u",
    
"\u",
    
"",
    
"aa",
    
"\xF5",
];

foreach (
$strings as $string) {
    
$decomposition Normalizer::getRawDecomposition($string);
    
// $decomposition = normalizer_get_raw_decomposition($string); Procedural way

    
$error_code intl_get_error_code();
    
$error_message intl_get_error_message();

    
$string_hex bin2hex($string);
    
$result .= "---------------------\n";

    if (
$decomposition === null) {
        
$result .= "'$string_hex' has no decomposition mapping\n" ;
    } else {
        
$result .= "'$string_hex' has the decomposition mapping '" bin2hex($decomposition) . "'\n" ;
    }

    
$result .= "error info: '$error_message' ($error_code)\n";
}

echo 
$result;
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

---------------------
'61' has no decomposition mapping
error info: 'U_ZERO_ERROR' (0)
---------------------
'efbf9a' has the decomposition mapping 'e385a1'
error info: 'U_ZERO_ERROR' (0)
---------------------
'efb7ba' has the decomposition mapping 'd8b5d984d98920d8a7d984d984d98720d8b9d984d98ad98720d988d8b3d984d985'
error info: 'U_ZERO_ERROR' (0)
---------------------
'' has no decomposition mapping
error info: 'Input string must be exactly one UTF-8 encoded code point long.: U_ILLEGAL_ARGUMENT_ERROR' (1)
---------------------
'6161' has no decomposition mapping
error info: 'Input string must be exactly one UTF-8 encoded code point long.: U_ILLEGAL_ARGUMENT_ERROR' (1)
---------------------
'f5' has no decomposition mapping
error info: 'Code point out of range: U_ILLEGAL_ARGUMENT_ERROR' (1)

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Seltsames Verhalten von execute() oder Fehler meinerseits

Hello You can check below steps - Check for errors after executing the statement. Bind parameters to placeholders in the SQL query. Confirm t ...

Geschrieben von nolanmaris am 20.05.2024 12:12:16
Forum: SQL / Datenbanken
Ein Problem mit der Lampe

Yes ..i was facing the same issue .

Geschrieben von nolanmaris am 20.05.2024 12:02:55
Forum: Off-Topic Diskussionen
Hello

Hello , I am new member here. I have around 8years of experience in developing User Interfaces for Mobile/Tablet/Desktop using HTML, CSS, JavaScri ...

Geschrieben von nolanmaris am 20.05.2024 12:01:22
Forum: User stellen sich vor
Daten einer Abfrage mit Hilfe von Thumbnails nebeneinander ausgeben

Also den Fehler habe ich gefunden und abgestellt. Warum soll ich float meiden?

Geschrieben von Malchor am 17.05.2024 20:54:01
Forum: PHP Developer Forum