aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author--global <--global>2014-05-27 18:49:16 +0000
committer--global <--global>2014-05-27 18:49:16 +0000
commit2fdcc7df07b6d25783a9334f56dba17e27e1bc03 (patch)
tree29df5413336236683a96832e39b08c2a31a5abe7
parentMerge branch 'master' of https://github.com/kisli/vmime (diff)
downloadvmime-2fdcc7df07b6d25783a9334f56dba17e27e1bc03.tar.gz
vmime-2fdcc7df07b6d25783a9334f56dba17e27e1bc03.zip
Fixed ICU status code checking.
-rw-r--r--src/vmime/charsetConverter_icu.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vmime/charsetConverter_icu.cpp b/src/vmime/charsetConverter_icu.cpp
index 3374d448..263ccc64 100644
--- a/src/vmime/charsetConverter_icu.cpp
+++ b/src/vmime/charsetConverter_icu.cpp
@@ -68,18 +68,18 @@ charsetConverter_icu::charsetConverter_icu
UErrorCode err = U_ZERO_ERROR;
m_from = ucnv_open(source.getName().c_str(), &err);
- if (err != U_ZERO_ERROR)
+ if (!U_SUCCESS(err))
{
throw exceptions::charset_conv_error
- ("Cannot initialize ICU converter for source charset '" + source.getName() + "'.");
+ ("Cannot initialize ICU converter for source charset '" + source.getName() + "' (error code: " + u_errorName(err) + ".");
}
m_to = ucnv_open(dest.getName().c_str(), &err);
- if (err != U_ZERO_ERROR)
+ if (!U_SUCCESS(err))
{
throw exceptions::charset_conv_error
- ("Cannot initialize ICU converter for destination charset '" + dest.getName() + "'.");
+ ("Cannot initialize ICU converter for destination charset '" + dest.getName() + "' (error code: " + u_errorName(err) + ".");
}
}
@@ -214,18 +214,18 @@ charsetFilteredOutputStream_icu::charsetFilteredOutputStream_icu
UErrorCode err = U_ZERO_ERROR;
m_from = ucnv_open(source.getName().c_str(), &err);
- if (err != U_ZERO_ERROR)
+ if (!U_SUCCESS(err))
{
throw exceptions::charset_conv_error
- ("Cannot initialize ICU converter for source charset '" + source.getName() + "'.");
+ ("Cannot initialize ICU converter for source charset '" + source.getName() + "' (error code: " + u_errorName(err) + ".");
}
m_to = ucnv_open(dest.getName().c_str(), &err);
- if (err != U_ZERO_ERROR)
+ if (!U_SUCCESS(err))
{
throw exceptions::charset_conv_error
- ("Cannot initialize ICU converter for destination charset '" + dest.getName() + "'.");
+ ("Cannot initialize ICU converter for destination charset '" + dest.getName() + "' (error code: " + u_errorName(err) + ".");
}
// Set replacement chars for when converting from Unicode to codepage