/* This file is automatically generated by unicode-ucd-compile.py from:
     ./ucd/CaseFolding.txt
     ./ucd/CompositionExclusions.txt
     ./ucd/DerivedBidiClass.txt
     ./ucd/DerivedCoreProperties.txt
     ./ucd/DerivedJoiningType.txt
     ./ucd/DerivedNormalizationProps.txt
     ./ucd/GraphemeBreakProperty.txt
     ./ucd/IdnaMappingTable.txt
     ./ucd/PropList.txt
     ./ucd/PropertyValueAliases.txt
     ./ucd/Scripts.txt
     ./ucd/SpecialCasing.txt
     ./ucd/UnicodeData.txt
     ./ucd/WordBreakProperty.txt
     ./ucd/emoji-data.txt
 */

#include "lib.h"
#include "unicode-data-types.h"

/* Script */
enum unicode_script unicode_script_from_string(const char *str)
{
	/* Unknown */
	if (strcasecmp(str, "Unknown") == 0)
		return UNICODE_SCRIPT_UNKNOWN;
	/* Inherited */
	else if (strcasecmp(str, "Inherited") == 0)
		return UNICODE_SCRIPT_INHERITED;
	/* Common */
	else if (strcasecmp(str, "Common") == 0)
		return UNICODE_SCRIPT_COMMON;
	/* Adlam */
	else if (strcasecmp(str, "Adlam") == 0)
		return UNICODE_SCRIPT_ADLAM;
	/* Caucasian_Albanian */
	else if (strcasecmp(str, "Caucasian_Albanian") == 0)
		return UNICODE_SCRIPT_CAUCASIAN_ALBANIAN;
	/* Ahom */
	else if (strcasecmp(str, "Ahom") == 0)
		return UNICODE_SCRIPT_AHOM;
	/* Arabic */
	else if (strcasecmp(str, "Arabic") == 0)
		return UNICODE_SCRIPT_ARABIC;
	/* Imperial_Aramaic */
	else if (strcasecmp(str, "Imperial_Aramaic") == 0)
		return UNICODE_SCRIPT_IMPERIAL_ARAMAIC;
	/* Armenian */
	else if (strcasecmp(str, "Armenian") == 0)
		return UNICODE_SCRIPT_ARMENIAN;
	/* Avestan */
	else if (strcasecmp(str, "Avestan") == 0)
		return UNICODE_SCRIPT_AVESTAN;
	/* Balinese */
	else if (strcasecmp(str, "Balinese") == 0)
		return UNICODE_SCRIPT_BALINESE;
	/* Bamum */
	else if (strcasecmp(str, "Bamum") == 0)
		return UNICODE_SCRIPT_BAMUM;
	/* Bassa_Vah */
	else if (strcasecmp(str, "Bassa_Vah") == 0)
		return UNICODE_SCRIPT_BASSA_VAH;
	/* Batak */
	else if (strcasecmp(str, "Batak") == 0)
		return UNICODE_SCRIPT_BATAK;
	/* Bengali */
	else if (strcasecmp(str, "Bengali") == 0)
		return UNICODE_SCRIPT_BENGALI;
	/* Beria_Erfe */
	else if (strcasecmp(str, "Beria_Erfe") == 0)
		return UNICODE_SCRIPT_BERIA_ERFE;
	/* Bhaiksuki */
	else if (strcasecmp(str, "Bhaiksuki") == 0)
		return UNICODE_SCRIPT_BHAIKSUKI;
	/* Bopomofo */
	else if (strcasecmp(str, "Bopomofo") == 0)
		return UNICODE_SCRIPT_BOPOMOFO;
	/* Brahmi */
	else if (strcasecmp(str, "Brahmi") == 0)
		return UNICODE_SCRIPT_BRAHMI;
	/* Braille */
	else if (strcasecmp(str, "Braille") == 0)
		return UNICODE_SCRIPT_BRAILLE;
	/* Buginese */
	else if (strcasecmp(str, "Buginese") == 0)
		return UNICODE_SCRIPT_BUGINESE;
	/* Buhid */
	else if (strcasecmp(str, "Buhid") == 0)
		return UNICODE_SCRIPT_BUHID;
	/* Chakma */
	else if (strcasecmp(str, "Chakma") == 0)
		return UNICODE_SCRIPT_CHAKMA;
	/* Canadian_Aboriginal */
	else if (strcasecmp(str, "Canadian_Aboriginal") == 0)
		return UNICODE_SCRIPT_CANADIAN_ABORIGINAL;
	/* Carian */
	else if (strcasecmp(str, "Carian") == 0)
		return UNICODE_SCRIPT_CARIAN;
	/* Cham */
	else if (strcasecmp(str, "Cham") == 0)
		return UNICODE_SCRIPT_CHAM;
	/* Cherokee */
	else if (strcasecmp(str, "Cherokee") == 0)
		return UNICODE_SCRIPT_CHEROKEE;
	/* Chorasmian */
	else if (strcasecmp(str, "Chorasmian") == 0)
		return UNICODE_SCRIPT_CHORASMIAN;
	/* Coptic */
	else if (strcasecmp(str, "Coptic") == 0)
		return UNICODE_SCRIPT_COPTIC;
	/* Cypro_Minoan */
	else if (strcasecmp(str, "Cypro_Minoan") == 0)
		return UNICODE_SCRIPT_CYPRO_MINOAN;
	/* Cypriot */
	else if (strcasecmp(str, "Cypriot") == 0)
		return UNICODE_SCRIPT_CYPRIOT;
	/* Cyrillic */
	else if (strcasecmp(str, "Cyrillic") == 0)
		return UNICODE_SCRIPT_CYRILLIC;
	/* Devanagari */
	else if (strcasecmp(str, "Devanagari") == 0)
		return UNICODE_SCRIPT_DEVANAGARI;
	/* Dives_Akuru */
	else if (strcasecmp(str, "Dives_Akuru") == 0)
		return UNICODE_SCRIPT_DIVES_AKURU;
	/* Dogra */
	else if (strcasecmp(str, "Dogra") == 0)
		return UNICODE_SCRIPT_DOGRA;
	/* Deseret */
	else if (strcasecmp(str, "Deseret") == 0)
		return UNICODE_SCRIPT_DESERET;
	/* Duployan */
	else if (strcasecmp(str, "Duployan") == 0)
		return UNICODE_SCRIPT_DUPLOYAN;
	/* Egyptian_Hieroglyphs */
	else if (strcasecmp(str, "Egyptian_Hieroglyphs") == 0)
		return UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS;
	/* Elbasan */
	else if (strcasecmp(str, "Elbasan") == 0)
		return UNICODE_SCRIPT_ELBASAN;
	/* Elymaic */
	else if (strcasecmp(str, "Elymaic") == 0)
		return UNICODE_SCRIPT_ELYMAIC;
	/* Ethiopic */
	else if (strcasecmp(str, "Ethiopic") == 0)
		return UNICODE_SCRIPT_ETHIOPIC;
	/* Garay */
	else if (strcasecmp(str, "Garay") == 0)
		return UNICODE_SCRIPT_GARAY;
	/* Georgian */
	else if (strcasecmp(str, "Georgian") == 0)
		return UNICODE_SCRIPT_GEORGIAN;
	/* Glagolitic */
	else if (strcasecmp(str, "Glagolitic") == 0)
		return UNICODE_SCRIPT_GLAGOLITIC;
	/* Gunjala_Gondi */
	else if (strcasecmp(str, "Gunjala_Gondi") == 0)
		return UNICODE_SCRIPT_GUNJALA_GONDI;
	/* Masaram_Gondi */
	else if (strcasecmp(str, "Masaram_Gondi") == 0)
		return UNICODE_SCRIPT_MASARAM_GONDI;
	/* Gothic */
	else if (strcasecmp(str, "Gothic") == 0)
		return UNICODE_SCRIPT_GOTHIC;
	/* Grantha */
	else if (strcasecmp(str, "Grantha") == 0)
		return UNICODE_SCRIPT_GRANTHA;
	/* Greek */
	else if (strcasecmp(str, "Greek") == 0)
		return UNICODE_SCRIPT_GREEK;
	/* Gujarati */
	else if (strcasecmp(str, "Gujarati") == 0)
		return UNICODE_SCRIPT_GUJARATI;
	/* Gurung_Khema */
	else if (strcasecmp(str, "Gurung_Khema") == 0)
		return UNICODE_SCRIPT_GURUNG_KHEMA;
	/* Gurmukhi */
	else if (strcasecmp(str, "Gurmukhi") == 0)
		return UNICODE_SCRIPT_GURMUKHI;
	/* Hangul */
	else if (strcasecmp(str, "Hangul") == 0)
		return UNICODE_SCRIPT_HANGUL;
	/* Han */
	else if (strcasecmp(str, "Han") == 0)
		return UNICODE_SCRIPT_HAN;
	/* Hanunoo */
	else if (strcasecmp(str, "Hanunoo") == 0)
		return UNICODE_SCRIPT_HANUNOO;
	/* Hatran */
	else if (strcasecmp(str, "Hatran") == 0)
		return UNICODE_SCRIPT_HATRAN;
	/* Hebrew */
	else if (strcasecmp(str, "Hebrew") == 0)
		return UNICODE_SCRIPT_HEBREW;
	/* Hiragana */
	else if (strcasecmp(str, "Hiragana") == 0)
		return UNICODE_SCRIPT_HIRAGANA;
	/* Anatolian_Hieroglyphs */
	else if (strcasecmp(str, "Anatolian_Hieroglyphs") == 0)
		return UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS;
	/* Pahawh_Hmong */
	else if (strcasecmp(str, "Pahawh_Hmong") == 0)
		return UNICODE_SCRIPT_PAHAWH_HMONG;
	/* Nyiakeng_Puachue_Hmong */
	else if (strcasecmp(str, "Nyiakeng_Puachue_Hmong") == 0)
		return UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG;
	/* Katakana_Or_Hiragana */
	else if (strcasecmp(str, "Katakana_Or_Hiragana") == 0)
		return UNICODE_SCRIPT_KATAKANA_OR_HIRAGANA;
	/* Old_Hungarian */
	else if (strcasecmp(str, "Old_Hungarian") == 0)
		return UNICODE_SCRIPT_OLD_HUNGARIAN;
	/* Old_Italic */
	else if (strcasecmp(str, "Old_Italic") == 0)
		return UNICODE_SCRIPT_OLD_ITALIC;
	/* Javanese */
	else if (strcasecmp(str, "Javanese") == 0)
		return UNICODE_SCRIPT_JAVANESE;
	/* Kayah_Li */
	else if (strcasecmp(str, "Kayah_Li") == 0)
		return UNICODE_SCRIPT_KAYAH_LI;
	/* Katakana */
	else if (strcasecmp(str, "Katakana") == 0)
		return UNICODE_SCRIPT_KATAKANA;
	/* Kawi */
	else if (strcasecmp(str, "Kawi") == 0)
		return UNICODE_SCRIPT_KAWI;
	/* Kharoshthi */
	else if (strcasecmp(str, "Kharoshthi") == 0)
		return UNICODE_SCRIPT_KHAROSHTHI;
	/* Khmer */
	else if (strcasecmp(str, "Khmer") == 0)
		return UNICODE_SCRIPT_KHMER;
	/* Khojki */
	else if (strcasecmp(str, "Khojki") == 0)
		return UNICODE_SCRIPT_KHOJKI;
	/* Khitan_Small_Script */
	else if (strcasecmp(str, "Khitan_Small_Script") == 0)
		return UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT;
	/* Kannada */
	else if (strcasecmp(str, "Kannada") == 0)
		return UNICODE_SCRIPT_KANNADA;
	/* Kirat_Rai */
	else if (strcasecmp(str, "Kirat_Rai") == 0)
		return UNICODE_SCRIPT_KIRAT_RAI;
	/* Kaithi */
	else if (strcasecmp(str, "Kaithi") == 0)
		return UNICODE_SCRIPT_KAITHI;
	/* Tai_Tham */
	else if (strcasecmp(str, "Tai_Tham") == 0)
		return UNICODE_SCRIPT_TAI_THAM;
	/* Lao */
	else if (strcasecmp(str, "Lao") == 0)
		return UNICODE_SCRIPT_LAO;
	/* Latin */
	else if (strcasecmp(str, "Latin") == 0)
		return UNICODE_SCRIPT_LATIN;
	/* Lepcha */
	else if (strcasecmp(str, "Lepcha") == 0)
		return UNICODE_SCRIPT_LEPCHA;
	/* Limbu */
	else if (strcasecmp(str, "Limbu") == 0)
		return UNICODE_SCRIPT_LIMBU;
	/* Linear_A */
	else if (strcasecmp(str, "Linear_A") == 0)
		return UNICODE_SCRIPT_LINEAR_A;
	/* Linear_B */
	else if (strcasecmp(str, "Linear_B") == 0)
		return UNICODE_SCRIPT_LINEAR_B;
	/* Lisu */
	else if (strcasecmp(str, "Lisu") == 0)
		return UNICODE_SCRIPT_LISU;
	/* Lycian */
	else if (strcasecmp(str, "Lycian") == 0)
		return UNICODE_SCRIPT_LYCIAN;
	/* Lydian */
	else if (strcasecmp(str, "Lydian") == 0)
		return UNICODE_SCRIPT_LYDIAN;
	/* Mahajani */
	else if (strcasecmp(str, "Mahajani") == 0)
		return UNICODE_SCRIPT_MAHAJANI;
	/* Makasar */
	else if (strcasecmp(str, "Makasar") == 0)
		return UNICODE_SCRIPT_MAKASAR;
	/* Mandaic */
	else if (strcasecmp(str, "Mandaic") == 0)
		return UNICODE_SCRIPT_MANDAIC;
	/* Manichaean */
	else if (strcasecmp(str, "Manichaean") == 0)
		return UNICODE_SCRIPT_MANICHAEAN;
	/* Marchen */
	else if (strcasecmp(str, "Marchen") == 0)
		return UNICODE_SCRIPT_MARCHEN;
	/* Medefaidrin */
	else if (strcasecmp(str, "Medefaidrin") == 0)
		return UNICODE_SCRIPT_MEDEFAIDRIN;
	/* Mende_Kikakui */
	else if (strcasecmp(str, "Mende_Kikakui") == 0)
		return UNICODE_SCRIPT_MENDE_KIKAKUI;
	/* Meroitic_Cursive */
	else if (strcasecmp(str, "Meroitic_Cursive") == 0)
		return UNICODE_SCRIPT_MEROITIC_CURSIVE;
	/* Meroitic_Hieroglyphs */
	else if (strcasecmp(str, "Meroitic_Hieroglyphs") == 0)
		return UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS;
	/* Malayalam */
	else if (strcasecmp(str, "Malayalam") == 0)
		return UNICODE_SCRIPT_MALAYALAM;
	/* Modi */
	else if (strcasecmp(str, "Modi") == 0)
		return UNICODE_SCRIPT_MODI;
	/* Mongolian */
	else if (strcasecmp(str, "Mongolian") == 0)
		return UNICODE_SCRIPT_MONGOLIAN;
	/* Mro */
	else if (strcasecmp(str, "Mro") == 0)
		return UNICODE_SCRIPT_MRO;
	/* Meetei_Mayek */
	else if (strcasecmp(str, "Meetei_Mayek") == 0)
		return UNICODE_SCRIPT_MEETEI_MAYEK;
	/* Multani */
	else if (strcasecmp(str, "Multani") == 0)
		return UNICODE_SCRIPT_MULTANI;
	/* Myanmar */
	else if (strcasecmp(str, "Myanmar") == 0)
		return UNICODE_SCRIPT_MYANMAR;
	/* Nag_Mundari */
	else if (strcasecmp(str, "Nag_Mundari") == 0)
		return UNICODE_SCRIPT_NAG_MUNDARI;
	/* Nandinagari */
	else if (strcasecmp(str, "Nandinagari") == 0)
		return UNICODE_SCRIPT_NANDINAGARI;
	/* Old_North_Arabian */
	else if (strcasecmp(str, "Old_North_Arabian") == 0)
		return UNICODE_SCRIPT_OLD_NORTH_ARABIAN;
	/* Nabataean */
	else if (strcasecmp(str, "Nabataean") == 0)
		return UNICODE_SCRIPT_NABATAEAN;
	/* Newa */
	else if (strcasecmp(str, "Newa") == 0)
		return UNICODE_SCRIPT_NEWA;
	/* Nko */
	else if (strcasecmp(str, "Nko") == 0)
		return UNICODE_SCRIPT_NKO;
	/* Nushu */
	else if (strcasecmp(str, "Nushu") == 0)
		return UNICODE_SCRIPT_NUSHU;
	/* Ogham */
	else if (strcasecmp(str, "Ogham") == 0)
		return UNICODE_SCRIPT_OGHAM;
	/* Ol_Chiki */
	else if (strcasecmp(str, "Ol_Chiki") == 0)
		return UNICODE_SCRIPT_OL_CHIKI;
	/* Ol_Onal */
	else if (strcasecmp(str, "Ol_Onal") == 0)
		return UNICODE_SCRIPT_OL_ONAL;
	/* Old_Turkic */
	else if (strcasecmp(str, "Old_Turkic") == 0)
		return UNICODE_SCRIPT_OLD_TURKIC;
	/* Oriya */
	else if (strcasecmp(str, "Oriya") == 0)
		return UNICODE_SCRIPT_ORIYA;
	/* Osage */
	else if (strcasecmp(str, "Osage") == 0)
		return UNICODE_SCRIPT_OSAGE;
	/* Osmanya */
	else if (strcasecmp(str, "Osmanya") == 0)
		return UNICODE_SCRIPT_OSMANYA;
	/* Old_Uyghur */
	else if (strcasecmp(str, "Old_Uyghur") == 0)
		return UNICODE_SCRIPT_OLD_UYGHUR;
	/* Palmyrene */
	else if (strcasecmp(str, "Palmyrene") == 0)
		return UNICODE_SCRIPT_PALMYRENE;
	/* Pau_Cin_Hau */
	else if (strcasecmp(str, "Pau_Cin_Hau") == 0)
		return UNICODE_SCRIPT_PAU_CIN_HAU;
	/* Old_Permic */
	else if (strcasecmp(str, "Old_Permic") == 0)
		return UNICODE_SCRIPT_OLD_PERMIC;
	/* Phags_Pa */
	else if (strcasecmp(str, "Phags_Pa") == 0)
		return UNICODE_SCRIPT_PHAGS_PA;
	/* Inscriptional_Pahlavi */
	else if (strcasecmp(str, "Inscriptional_Pahlavi") == 0)
		return UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI;
	/* Psalter_Pahlavi */
	else if (strcasecmp(str, "Psalter_Pahlavi") == 0)
		return UNICODE_SCRIPT_PSALTER_PAHLAVI;
	/* Phoenician */
	else if (strcasecmp(str, "Phoenician") == 0)
		return UNICODE_SCRIPT_PHOENICIAN;
	/* Miao */
	else if (strcasecmp(str, "Miao") == 0)
		return UNICODE_SCRIPT_MIAO;
	/* Inscriptional_Parthian */
	else if (strcasecmp(str, "Inscriptional_Parthian") == 0)
		return UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN;
	/* Rejang */
	else if (strcasecmp(str, "Rejang") == 0)
		return UNICODE_SCRIPT_REJANG;
	/* Hanifi_Rohingya */
	else if (strcasecmp(str, "Hanifi_Rohingya") == 0)
		return UNICODE_SCRIPT_HANIFI_ROHINGYA;
	/* Runic */
	else if (strcasecmp(str, "Runic") == 0)
		return UNICODE_SCRIPT_RUNIC;
	/* Samaritan */
	else if (strcasecmp(str, "Samaritan") == 0)
		return UNICODE_SCRIPT_SAMARITAN;
	/* Old_South_Arabian */
	else if (strcasecmp(str, "Old_South_Arabian") == 0)
		return UNICODE_SCRIPT_OLD_SOUTH_ARABIAN;
	/* Saurashtra */
	else if (strcasecmp(str, "Saurashtra") == 0)
		return UNICODE_SCRIPT_SAURASHTRA;
	/* SignWriting */
	else if (strcasecmp(str, "SignWriting") == 0)
		return UNICODE_SCRIPT_SIGNWRITING;
	/* Shavian */
	else if (strcasecmp(str, "Shavian") == 0)
		return UNICODE_SCRIPT_SHAVIAN;
	/* Sharada */
	else if (strcasecmp(str, "Sharada") == 0)
		return UNICODE_SCRIPT_SHARADA;
	/* Siddham */
	else if (strcasecmp(str, "Siddham") == 0)
		return UNICODE_SCRIPT_SIDDHAM;
	/* Sidetic */
	else if (strcasecmp(str, "Sidetic") == 0)
		return UNICODE_SCRIPT_SIDETIC;
	/* Khudawadi */
	else if (strcasecmp(str, "Khudawadi") == 0)
		return UNICODE_SCRIPT_KHUDAWADI;
	/* Sinhala */
	else if (strcasecmp(str, "Sinhala") == 0)
		return UNICODE_SCRIPT_SINHALA;
	/* Sogdian */
	else if (strcasecmp(str, "Sogdian") == 0)
		return UNICODE_SCRIPT_SOGDIAN;
	/* Old_Sogdian */
	else if (strcasecmp(str, "Old_Sogdian") == 0)
		return UNICODE_SCRIPT_OLD_SOGDIAN;
	/* Sora_Sompeng */
	else if (strcasecmp(str, "Sora_Sompeng") == 0)
		return UNICODE_SCRIPT_SORA_SOMPENG;
	/* Soyombo */
	else if (strcasecmp(str, "Soyombo") == 0)
		return UNICODE_SCRIPT_SOYOMBO;
	/* Sundanese */
	else if (strcasecmp(str, "Sundanese") == 0)
		return UNICODE_SCRIPT_SUNDANESE;
	/* Sunuwar */
	else if (strcasecmp(str, "Sunuwar") == 0)
		return UNICODE_SCRIPT_SUNUWAR;
	/* Syloti_Nagri */
	else if (strcasecmp(str, "Syloti_Nagri") == 0)
		return UNICODE_SCRIPT_SYLOTI_NAGRI;
	/* Syriac */
	else if (strcasecmp(str, "Syriac") == 0)
		return UNICODE_SCRIPT_SYRIAC;
	/* Tagbanwa */
	else if (strcasecmp(str, "Tagbanwa") == 0)
		return UNICODE_SCRIPT_TAGBANWA;
	/* Takri */
	else if (strcasecmp(str, "Takri") == 0)
		return UNICODE_SCRIPT_TAKRI;
	/* Tai_Le */
	else if (strcasecmp(str, "Tai_Le") == 0)
		return UNICODE_SCRIPT_TAI_LE;
	/* New_Tai_Lue */
	else if (strcasecmp(str, "New_Tai_Lue") == 0)
		return UNICODE_SCRIPT_NEW_TAI_LUE;
	/* Tamil */
	else if (strcasecmp(str, "Tamil") == 0)
		return UNICODE_SCRIPT_TAMIL;
	/* Tangut */
	else if (strcasecmp(str, "Tangut") == 0)
		return UNICODE_SCRIPT_TANGUT;
	/* Tai_Viet */
	else if (strcasecmp(str, "Tai_Viet") == 0)
		return UNICODE_SCRIPT_TAI_VIET;
	/* Tai_Yo */
	else if (strcasecmp(str, "Tai_Yo") == 0)
		return UNICODE_SCRIPT_TAI_YO;
	/* Telugu */
	else if (strcasecmp(str, "Telugu") == 0)
		return UNICODE_SCRIPT_TELUGU;
	/* Tifinagh */
	else if (strcasecmp(str, "Tifinagh") == 0)
		return UNICODE_SCRIPT_TIFINAGH;
	/* Tagalog */
	else if (strcasecmp(str, "Tagalog") == 0)
		return UNICODE_SCRIPT_TAGALOG;
	/* Thaana */
	else if (strcasecmp(str, "Thaana") == 0)
		return UNICODE_SCRIPT_THAANA;
	/* Thai */
	else if (strcasecmp(str, "Thai") == 0)
		return UNICODE_SCRIPT_THAI;
	/* Tibetan */
	else if (strcasecmp(str, "Tibetan") == 0)
		return UNICODE_SCRIPT_TIBETAN;
	/* Tirhuta */
	else if (strcasecmp(str, "Tirhuta") == 0)
		return UNICODE_SCRIPT_TIRHUTA;
	/* Tangsa */
	else if (strcasecmp(str, "Tangsa") == 0)
		return UNICODE_SCRIPT_TANGSA;
	/* Todhri */
	else if (strcasecmp(str, "Todhri") == 0)
		return UNICODE_SCRIPT_TODHRI;
	/* Tolong_Siki */
	else if (strcasecmp(str, "Tolong_Siki") == 0)
		return UNICODE_SCRIPT_TOLONG_SIKI;
	/* Toto */
	else if (strcasecmp(str, "Toto") == 0)
		return UNICODE_SCRIPT_TOTO;
	/* Tulu_Tigalari */
	else if (strcasecmp(str, "Tulu_Tigalari") == 0)
		return UNICODE_SCRIPT_TULU_TIGALARI;
	/* Ugaritic */
	else if (strcasecmp(str, "Ugaritic") == 0)
		return UNICODE_SCRIPT_UGARITIC;
	/* Vai */
	else if (strcasecmp(str, "Vai") == 0)
		return UNICODE_SCRIPT_VAI;
	/* Vithkuqi */
	else if (strcasecmp(str, "Vithkuqi") == 0)
		return UNICODE_SCRIPT_VITHKUQI;
	/* Warang_Citi */
	else if (strcasecmp(str, "Warang_Citi") == 0)
		return UNICODE_SCRIPT_WARANG_CITI;
	/* Wancho */
	else if (strcasecmp(str, "Wancho") == 0)
		return UNICODE_SCRIPT_WANCHO;
	/* Old_Persian */
	else if (strcasecmp(str, "Old_Persian") == 0)
		return UNICODE_SCRIPT_OLD_PERSIAN;
	/* Cuneiform */
	else if (strcasecmp(str, "Cuneiform") == 0)
		return UNICODE_SCRIPT_CUNEIFORM;
	/* Yezidi */
	else if (strcasecmp(str, "Yezidi") == 0)
		return UNICODE_SCRIPT_YEZIDI;
	/* Yi */
	else if (strcasecmp(str, "Yi") == 0)
		return UNICODE_SCRIPT_YI;
	/* Zanabazar_Square */
	else if (strcasecmp(str, "Zanabazar_Square") == 0)
		return UNICODE_SCRIPT_ZANABAZAR_SQUARE;

	return UNICODE_SCRIPT_UNKNOWN;
}

/* Joining_Type */
enum unicode_joining_type unicode_joining_type_from_string(const char *str)
{
	/* Non_Joining */
	if (strcasecmp(str, "U") == 0)
		return UNICODE_JOINING_TYPE_U;
	/* Join_Causing */
	else if (strcasecmp(str, "C") == 0)
		return UNICODE_JOINING_TYPE_C;
	/* Dual_Joining */
	else if (strcasecmp(str, "D") == 0)
		return UNICODE_JOINING_TYPE_D;
	/* Left_Joining */
	else if (strcasecmp(str, "L") == 0)
		return UNICODE_JOINING_TYPE_L;
	/* Right_Joining */
	else if (strcasecmp(str, "R") == 0)
		return UNICODE_JOINING_TYPE_R;
	/* Transparent */
	else if (strcasecmp(str, "T") == 0)
		return UNICODE_JOINING_TYPE_T;

	return UNICODE_JOINING_TYPE_U;
}

/* Decomposition_Type */
enum unicode_decomposition_type
unicode_decomposition_type_from_string(const char *str)
{
	/* Canonical */
	if (strcasecmp(str, "Canonical") == 0)
		return UNICODE_DECOMPOSITION_TYPE_CANONICAL;
	/* <Compat> */
	else if (strcasecmp(str, "Compat") == 0)
		return UNICODE_DECOMPOSITION_TYPE_COMPAT;
	/* <Circle> */
	else if (strcasecmp(str, "Circle") == 0)
		return UNICODE_DECOMPOSITION_TYPE_CIRCLE;
	/* <Final> */
	else if (strcasecmp(str, "Final") == 0)
		return UNICODE_DECOMPOSITION_TYPE_FINAL;
	/* <Font> */
	else if (strcasecmp(str, "Font") == 0)
		return UNICODE_DECOMPOSITION_TYPE_FONT;
	/* <Fraction> */
	else if (strcasecmp(str, "Fraction") == 0)
		return UNICODE_DECOMPOSITION_TYPE_FRACTION;
	/* <Initial> */
	else if (strcasecmp(str, "Initial") == 0)
		return UNICODE_DECOMPOSITION_TYPE_INITIAL;
	/* <Isolated> */
	else if (strcasecmp(str, "Isolated") == 0)
		return UNICODE_DECOMPOSITION_TYPE_ISOLATED;
	/* <Medial> */
	else if (strcasecmp(str, "Medial") == 0)
		return UNICODE_DECOMPOSITION_TYPE_MEDIAL;
	/* <Narrow> */
	else if (strcasecmp(str, "Narrow") == 0)
		return UNICODE_DECOMPOSITION_TYPE_NARROW;
	/* <Nobreak> */
	else if (strcasecmp(str, "Nobreak") == 0)
		return UNICODE_DECOMPOSITION_TYPE_NOBREAK;
	/* <None> */
	else if (strcasecmp(str, "None") == 0)
		return UNICODE_DECOMPOSITION_TYPE_NONE;
	/* <Small> */
	else if (strcasecmp(str, "Small") == 0)
		return UNICODE_DECOMPOSITION_TYPE_SMALL;
	/* <Square> */
	else if (strcasecmp(str, "Square") == 0)
		return UNICODE_DECOMPOSITION_TYPE_SQUARE;
	/* <Sub> */
	else if (strcasecmp(str, "Sub") == 0)
		return UNICODE_DECOMPOSITION_TYPE_SUB;
	/* <Super> */
	else if (strcasecmp(str, "Super") == 0)
		return UNICODE_DECOMPOSITION_TYPE_SUPER;
	/* <Vertical> */
	else if (strcasecmp(str, "Vertical") == 0)
		return UNICODE_DECOMPOSITION_TYPE_VERTICAL;
	/* <Wide> */
	else if (strcasecmp(str, "Wide") == 0)
		return UNICODE_DECOMPOSITION_TYPE_WIDE;

	return UNICODE_DECOMPOSITION_TYPE_CANONICAL;
}
