]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: unicode-ucd-compile.py - Use write_tables_c_cpd() also for codepoint defaults
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 22 Nov 2025 17:02:50 +0000 (18:02 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 8 Dec 2025 14:37:04 +0000 (14:37 +0000)
src/lib/unicode-ucd-compile.py

index c3ee3056e4a879ee178b8a5d4054921f3ffdb658..d7f607f8c50206ac7465ffee3432066a2a1c5485 100755 (executable)
@@ -1197,10 +1197,13 @@ def write_tables_h():
 
 
 def write_tables_c_cpd(cpd):
-    print(
-        "\t\t.general_category = %s,"
-        % get_general_category_def(cpd.general_category)
-    )
+    if hasattr(cpd, "general_category"):
+        print(
+            "\t\t.general_category = %s,"
+            % get_general_category_def(cpd.general_category)
+        )
+    else:
+        print("\t\t.general_category = UNICODE_GENERAL_CATEGORY_CN,")
     if (
         hasattr(cpd, "canonical_combining_class")
         and cpd.canonical_combining_class > 0
@@ -1389,13 +1392,8 @@ def write_tables_c():
         for cpd in ud_codepoints_defaults:
             print("\t{ // [%04X] <defaults>" % n)
             n = n + 1
-            if hasattr(cpd, "general_category"):
-                print(
-                    "\t\t.general_category = %s,"
-                    % get_general_category_def(cpd.general_category)
-                )
-            else:
-                print("\t\t.general_category = UNICODE_GENERAL_CATEGORY_CN,")
+
+            write_tables_c_cpd(cpd)
             print("\t},")
         for cpr in ud_codepoints:
             cpd = cpr.data