From a184262d9b5b4215e68893631b669d4b9ed08b3c Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 14 Apr 2017 13:08:56 +0100 Subject: [PATCH] Add Other_Uppercase support from PropList.txt. --- src/include/ucd/ucd.h | 2 ++ src/proplist.c | 9 +++++---- tools/printdata.py | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/include/ucd/ucd.h b/src/include/ucd/ucd.h index 83473b3d..d0ecafbc 100644 --- a/src/include/ucd/ucd.h +++ b/src/include/ucd/ucd.h @@ -345,6 +345,7 @@ typedef enum ucd_property_ UCD_PROPERTY_DIACRITIC = 0x00002000, /**< @brief Diacritic PropList */ UCD_PROPERTY_EXTENDER = 0x00004000, /**< @brief Extender PropList */ UCD_PROPERTY_OTHER_LOWERCASE = 0x00008000, /**< @brief Other_Lowercase PropList */ + UCD_PROPERTY_OTHER_UPPERCASE = 0x00010000, /**< @brief Other_Uppercase PropList */ } ucd_property; /** @brief Return the properties of the specified codepoint. @@ -820,6 +821,7 @@ namespace ucd Diacritic = UCD_PROPERTY_DIACRITIC, /**< @brief Diacritic PropList */ Extender = UCD_PROPERTY_EXTENDER, /**< @brief Extender PropList */ Other_Lowercase = UCD_PROPERTY_OTHER_LOWERCASE, /**< @brief Other_Lowercase PropList */ + Other_Uppercase = UCD_PROPERTY_OTHER_UPPERCASE, /**< @brief Other_Uppercase PropList */ }; /** @brief Return the properties of the specified codepoint. diff --git a/src/proplist.c b/src/proplist.c index e88fff65..525b45e9 100644 --- a/src/proplist.c +++ b/src/proplist.c @@ -999,6 +999,7 @@ static int properties_Nl(codepoint_t c) switch (c & 0xFFFFFF00) { case 0x2100: + if (c >= 0x2160 && c <= 0x216F) return UCD_PROPERTY_OTHER_UPPERCASE; if (c >= 0x2170 && c <= 0x217F) return UCD_PROPERTY_OTHER_LOWERCASE; break; case 0x3000: @@ -1469,7 +1470,7 @@ static int properties_So(codepoint_t c) if (c == 0x23E2) return UCD_PROPERTY_OTHER_MATH; break; case 0x2400: - if (c >= 0x24B6 && c <= 0x24CF) return UCD_PROPERTY_OTHER_ALPHABETIC; + if (c >= 0x24B6 && c <= 0x24CF) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE; if (c >= 0x24D0 && c <= 0x24E9) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_LOWERCASE; break; case 0x2500: @@ -1491,9 +1492,9 @@ static int properties_So(codepoint_t c) if (c >= 0x266D && c <= 0x266E) return UCD_PROPERTY_OTHER_MATH; break; case 0x01F100: - if (c >= 0x01F130 && c <= 0x01F149) return UCD_PROPERTY_OTHER_ALPHABETIC; - if (c >= 0x01F150 && c <= 0x01F169) return UCD_PROPERTY_OTHER_ALPHABETIC; - if (c >= 0x01F170 && c <= 0x01F189) return UCD_PROPERTY_OTHER_ALPHABETIC; + if (c >= 0x01F130 && c <= 0x01F149) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE; + if (c >= 0x01F150 && c <= 0x01F169) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE; + if (c >= 0x01F170 && c <= 0x01F189) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_UPPERCASE; break; } return 0; diff --git a/tools/printdata.py b/tools/printdata.py index f139009e..58b31fe7 100755 --- a/tools/printdata.py +++ b/tools/printdata.py @@ -137,6 +137,7 @@ def properties(data): props += 8192 * data.get('Diacritic', 0) props += 16384 * data.get('Extender', 0) props += 32768 * data.get('Other_Lowercase', 0) + props += 65536 * data.get('Other_Uppercase', 0) return props if __name__ == '__main__':