Tizen Native API
|
Functions | |
int | i18n_uchar_get_int_property_value (i18n_uchar32 c, i18n_uchar_uproperty_e which, int32_t *property_val) |
Gets the property value for an enumerated property for a code point. | |
int | i18n_uchar_get_ublock_code (i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val) |
Gets the Unicode allocation block that contains the character. |
The Uchar module provides low-level access to the Unicode Character Database.
#include <utils_i18n.h>
The Uchar module provides low-level access to the Unicode Character Database.
Gets the property value of 'east asian width' among an enumerated property, and the unicode allocation block that contains the character.
int ret = I18N_ERROR_NONE; i18n_uchar32 code_point = 0; int property_value = 0; i18n_uchar_u_east_asian_width_e east_asian_width = I18N_UCHAR_U_EA_NEUTRAL; i18n_uchar_ublock_code_e block_code = I18N_UCHAR_UBLOCK_NO_BLOCK; // How to get the east asian width type for 's' code_point = 0x73; // 's' ret = i18n_uchar_get_int_property_value(code_point, I18N_UCHAR_EAST_ASIAN_WIDTH, &property_value); if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "Error occured!!\n"); } else { east_asian_width = (i18n_uchar_u_east_asian_width_e)property_value; dlog_print(DLOG_INFO, LOG_TAG, "East Asian Width Type for ( %.4x ) is ( %d )\n", code_point, east_asian_width); // East Asian Width Type for ( 0073 ) is ( 4 ) which is I18N_UCHAR_U_EA_NARROW } // How to get the block code for 's' ret = i18n_uchar_get_ublock_code(code_point, &block_code); if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "Error occured!!\n"); } else { dlog_print(DLOG_INFO, LOG_TAG, "block name for ( %.4x ) is ( %d )\n", code_point, block_code); // block code for ( 0073 ) is ( 1 ) which is I18N_UCHAR_UBLOCK_BASIC_LATIN } // How to get the east asian width type for 'sung' as ideographs code_point = 0x661F; // 'sung' as ideographs ret = i18n_uchar_get_int_property_value(code_point, I18N_UCHAR_EAST_ASIAN_WIDTH, &property_value); if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "Error occured!!\n"); } else { east_asian_width = (i18n_uchar_u_east_asian_width_e)property_value; dlog_print(DLOG_INFO, LOG_TAG, "East Asian Width Type for ( %.4x ) is ( %d )\n", code_point, east_asian_width); // East Asian Width Type for ( 661f ) is ( 5 ) which is I18N_UCHAR_U_EA_WIDE } // How to get the block code for 'sung' as ideographs ret = i18n_uchar_get_ublock_code(code_point, &block_code); if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "Error occured!!\n"); } else { dlog_print(DLOG_INFO, LOG_TAG, "block name for ( %.4x ) is ( %d )\n", code_point, block_code); // block code for ( 661f ) is ( 71 ) which is I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS } // How to get the east asian width type for 'sung' as hangul code_point = 0xC131; // 'sung' as hangul ret = i18n_uchar_get_int_property_value(code_point, I18N_UCHAR_EAST_ASIAN_WIDTH, &property_value); if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "Error occured!!\n"); } else { east_asian_width = (i18n_uchar_u_east_asian_width_e)property_value; dlog_print(DLOG_INFO, LOG_TAG, "East Asian Width Type for ( %.4x ) is ( %d )\n", code_point, east_asian_width); // East Asian Width Type for ( c131 ) is ( 5 ) which is I18N_UCHAR_U_EA_WIDE } // How to get the block code for 'sung' as hangul ret = i18n_uchar_get_ublock_code(code_point, &block_code); if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "Error occured!!\n"); } else { dlog_print(DLOG_INFO, LOG_TAG, "block name for ( %.4x ) is ( %d )\n", code_point, block_code); // block code for ( c131 ) is ( 74 ) which is I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES }
Enumeration for Unicode general category types.
Enumeration for the language directional property of a character set.
Enumeration for Decomposition Type constants.
Enumeration for Grapheme Cluster Break constants.
Enumeration for Joining Group constants.
Enumeration for Line Break constants.
Enumeration for Sentence Break constants.
Enumeration for Word Break constants.
Constants for Unicode blocks, see the Unicode Data file Blocks.txt.
Enumeration of constants for Unicode properties. The properties APIs are intended to reflect Unicode properties as defined in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). For details about the properties see http://www.unicode.org/ucd/ . For names of Unicode properties see the UCD file PropertyAliases.txt.
int i18n_uchar_get_int_property_value | ( | i18n_uchar32 | c, |
i18n_uchar_uproperty_e | which, | ||
int32_t * | property_val | ||
) |
Gets the property value for an enumerated property for a code point.
int property_value;
i18n_uchar_u_east_asian_width_e east_asian_width;
i18n_uchar_get_int_property_value (c, I18N_UCHAR_EAST_ASIAN_WIDTH, &property_value);
east_asian_width = (i18n_uchar_u_east_asian_width_e)property_value;
int property_value;
bool is_ideographic;
i18n_uchar_get_int_property_value(c, I18N_UCHAR_IDEOGRAPHIC, &property_value);
is_ideographic = (bool)property_value;
[in] | c | The code point to test. |
[in] | which | The i18n_uchar_uproperty_e selector constant, identifies which property to check Must be I18N_UCHAR_BINARY_START<=which<I18N_UCHAR_BINARY_LIMIT or I18N_UCHAR_INT_START<=which<I18N_UCHAR_INT_LIMIT or I18N_UCHAR_MASK_START<=which<I18N_UCHAR_MASK_LIMIT. |
[out] | property_val | The numeric value that is directly the property value or, for enumerated properties, corresponds to the numeric value of the enumerated constant of the respective property value enumeration type (cast to enum type if necessary) Returns 0 or 1 (for FALSE/TRUE) for binary Unicode propertiesReturns a bit-mask for mask properties Returns 0 if 'which' is out of bounds or if the Unicode version does not have data for the property at all, or not for this code point. |
I18N_ERROR_NONE | Successful |
I18N_ERROR_INVALID_PARAMETER | Invalid function parameter |
int i18n_uchar_get_ublock_code | ( | i18n_uchar32 | c, |
i18n_uchar_ublock_code_e * | block_val | ||
) |
Gets the Unicode allocation block that contains the character.
[in] | c | The code point to test |
[out] | block_val | The block value for the code point |
I18N_ERROR_NONE | Successful |
I18N_ERROR_INVALID_PARAMETER | Invalid function parameter |