List of Ideographic Countries

To solve a recent problem on api.wordpress.org, I needed a list of countries where ideographic languages like Chinese and Japanese are commonly used.

I couldn’t find a pre-made one, but I was able to build one from Wikipedia’s article on writing systems.

Since that was kind of tedious, I thought I’d share the result in order to spare anyone else from having to do it:

/**
* Get an array of countries where ideographic languages are common
*
* Derived from https://en.wikipedia.org/wiki/List_of_writing_systems#List_of_writing_scripts_by_adoption
*
* Note: Some of these individual countries (or entire categories)  may not technically use ideographic languages, and might be able to be removed, depending on your requirements.
*/
function get_ideographic_counties() {
    $middle_east  = array( 'AE', 'BH', 'CY', 'EG', 'IL', 'IR', 'IQ', 'JO', 'KW', 'LB', 'OM', 'PS', 'QA', 'SA', 'SY', 'TR', 'YE' );
    $north_africa = array( 'DZ', 'EH', 'EG', 'LY', 'MA', 'SD', 'SS', 'TN' );

    $abjad_countries       = array_merge( $middle_east, $north_africa, array( 'CN', 'IL', 'IN', 'MY', 'PK' ) );
    $abugida_countries     = array( 'BD', 'BT', 'ER', 'ET', 'ID', 'IN', 'KH', 'LA', 'LK', 'MV', 'MY', 'MU', 'MM', 'NP', 'PK', 'SG', 'TH' );
    $logographic_countries = array( 'CN', 'JP', 'KR', 'MY', 'SG');

    $all_ideographic_countries = array_merge( $abjad_countries, $abugida_countries, $logographic_countries );

    return array_unique( $all_ideographic_countries );
}

Leave a Reply

Your email address will not be published. Required fields are marked *