mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
warn upon ucnv_setSubstString() failures
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
4bced12c05
commit
a0d3354077
1 changed files with 12 additions and 10 deletions
|
@ -994,8 +994,9 @@ UConverter *QIcuCodec::getConverter(QTextCodec::ConverterState *state) const
|
|||
} else {
|
||||
ucnv_setSubstString(static_cast<UConverter *>(state->d), questionmarkchar, 1, &error);
|
||||
}
|
||||
if (Q_UNLIKELY(U_FAILURE(error)))
|
||||
if (Q_UNLIKELY(U_FAILURE(error))) {
|
||||
qWarning("QIcuCodec::getConverter: ucnv_setSubstString(%s) failed %s", m_name, u_errorName(error));
|
||||
}
|
||||
|
||||
conv = static_cast<UConverter *>(state->d);
|
||||
}
|
||||
|
@ -1011,8 +1012,9 @@ UConverter *QIcuCodec::getConverter(QTextCodec::ConverterState *state) const
|
|||
if (conv) {
|
||||
error = U_ZERO_ERROR;
|
||||
ucnv_setSubstString(conv, questionmarkchar, 1, &error);
|
||||
if (Q_UNLIKELY(U_FAILURE(error)))
|
||||
if (Q_UNLIKELY(U_FAILURE(error))) {
|
||||
qWarning("QIcuCodec::getConverter: ucnv_setSubstString(%s) failed %s", m_name, u_errorName(error));
|
||||
}
|
||||
}
|
||||
}
|
||||
return conv;
|
||||
|
@ -1032,10 +1034,10 @@ QString QIcuCodec::convertToUnicode(const char *src, int length, QTextCodec::Con
|
|||
error = U_ZERO_ERROR;
|
||||
char errorbytes[10];
|
||||
int8_t invalidlen = 0;
|
||||
ucnv_getInvalidChars(conv,
|
||||
errorbytes,
|
||||
&invalidlen,
|
||||
&error);
|
||||
ucnv_getInvalidChars(conv, errorbytes, &invalidlen, &error);
|
||||
if (Q_UNLIKELY(U_FAILURE(error))) {
|
||||
qWarning("QIcuCodec::convertToUnicode: ucnv_getInvalidChars(%s) failed %s", m_name, u_errorName(error));
|
||||
}
|
||||
state->invalidChars = invalidlen;
|
||||
}
|
||||
} else {
|
||||
|
@ -1063,10 +1065,10 @@ QByteArray QIcuCodec::convertFromUnicode(const QChar *unicode, int length, QText
|
|||
error = U_ZERO_ERROR;
|
||||
char errorbytes[10];
|
||||
int8_t invalidlen = 0;
|
||||
ucnv_getInvalidChars(conv,
|
||||
errorbytes,
|
||||
&invalidlen,
|
||||
&error);
|
||||
ucnv_getInvalidChars(conv, errorbytes, &invalidlen, &error);
|
||||
if (Q_UNLIKELY(U_FAILURE(error))) {
|
||||
qWarning("QIcuCodec::convertFromUnicode: ucnv_getInvalidChars(%s) failed %s", m_name, u_errorName(error));
|
||||
}
|
||||
state->invalidChars = invalidlen;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue