function ut_main()
{
    $res = '';
    $coll = ut_coll_create('ru_RU');
    // Try specifying a correct attribute.
    ut_coll_get_attribute($coll, Collator::NORMALIZATION_MODE);
    $status = ut_coll_get_error_message($coll);
    $res .= $status . "\n";
    // Try specifying an incorrect attribute.
    ut_coll_get_attribute($coll, 12345);
    $status = ut_coll_get_error_message($coll);
    $res .= $status . "\n";
    return $res;
}
示例#2
0
function ut_main()
{
    $res = '';
    $coll = ut_coll_create('ru_RU');
    // Try specifying a correct attribute.
    ut_coll_get_attribute($coll, Collator::NORMALIZATION_MODE);
    $status = ut_coll_get_error_code($coll);
    $res .= check_rc($status, U_ZERO_ERROR);
    // Try specifying an incorrect attribute.
    ut_coll_get_attribute($coll, 12345);
    $status = ut_coll_get_error_code($coll);
    $res .= check_rc($status, U_ILLEGAL_ARGUMENT_ERROR);
    return $res;
}
function check_val($coll)
{
    $val = ut_coll_get_attribute($coll, Collator::NORMALIZATION_MODE);
    return sprintf("%s\n", $val == Collator::OFF ? "off" : "on");
}