Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE UMeasurementSystem U_EXPORT2 ulocdata_getMeasurementSystem ( const char *  localeID,
UErrorCode status 

Returns the measurement system used in the locale specified by the localeID. Please note that this API will change in ICU 3.6 and will use an ulocdata object.

localeID The id of the locale for which the measurement system to be retrieved.
status Must be a valid pointer to an error code value, which must not indicate a failure before the function call.
UMeasurementSystem the measurement system used in the locale. ICU 2.8

Definition at line 188 of file ulocdata.c.

References NULL, U_FAILURE, and UMS_LIMIT.


    UResourceBundle* bundle=NULL;
    UResourceBundle* measurement=NULL;
    UMeasurementSystem system = UMS_LIMIT;

    if(status == NULL || U_FAILURE(*status)){
        return system;

    bundle = ures_open(NULL, localeID, status);

    measurement = ures_getByKeyWithFallback(bundle, MEASUREMENT_SYSTEM, NULL, status);

    system = (UMeasurementSystem) ures_getInt(measurement, status);


    return system;


Generated by  Doxygen 1.6.0   Back to index