mirror of
https://github.com/boostorg/regex.git
synced 2025-07-29 20:17:24 +02:00
@ -21,6 +21,11 @@
|
||||
#error "Mixing ICU with a static runtime doesn't work"
|
||||
#endif
|
||||
|
||||
void print_error(UErrorCode err, const char* func)
|
||||
{
|
||||
std::cerr << "Error from function " << func << " with error: " << ::u_errorName(err) << std::endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// To detect possible binary mismatches between the installed ICU build, and whatever
|
||||
@ -31,8 +36,17 @@ int main()
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, "GREEK SMALL LETTER ALPHA", &err);
|
||||
std::cout << (int)c << std::endl;
|
||||
if(err > 0) return err;
|
||||
if(err > 0)
|
||||
{
|
||||
print_error(err, "u_charFromName");
|
||||
return err;
|
||||
}
|
||||
U_NAMESPACE_QUALIFIER Locale l;
|
||||
boost::scoped_ptr<U_NAMESPACE_QUALIFIER Collator> p_col(U_NAMESPACE_QUALIFIER Collator::createInstance(l, err));
|
||||
if(err > 0)
|
||||
{
|
||||
print_error(err, "Collator::createInstance");
|
||||
return err;
|
||||
}
|
||||
return err > 0 ? err : 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user