SyntaxExcpetion changed into DataFormatException; couple of comment fixes

This commit is contained in:
Aleksandar Fabijanic
2008-01-05 21:22:12 +00:00
parent e1d27fecba
commit b57f579d16
2 changed files with 6 additions and 6 deletions

View File

@@ -46,22 +46,22 @@ namespace ODBC {
void makeUTF16(SQLCHAR* pSQLChar, SQLINTEGER length, std::string& target);
/// Utility function for conversion from ASCII to UTF-16
/// Utility function for conversion from UTF-8 to UTF-16
inline void makeUTF16(SQLCHAR* pSQLChar, SQLSMALLINT length, std::string& target)
/// Utility function for conversion from ASCII to UTF-16.
/// Utility function for conversion from UTF-8 to UTF-16.
{
makeUTF16(pSQLChar, (SQLINTEGER) length, target);
}
inline void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, int length, SQLPOINTER pTarget, SQLINTEGER targetLength);
/// Utility function for conversion from UTF-16 to ASCII.
/// Utility function for conversion from UTF-16 to UTF-8.
inline void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, int length, SQLPOINTER pTarget, SQLSMALLINT targetLength)
/// Utility function for conversion from UTF-16 to ASCII.
/// Utility function for conversion from UTF-16 to UTF-8.
{
makeUTF8(buffer, length, pTarget, (SQLINTEGER) targetLength);
}

View File

@@ -68,7 +68,7 @@ void makeUTF16(SQLCHAR* pSQLChar, SQLINTEGER length, std::string& target)
TextConverter converter(utf8Encoding, utf16Encoding);
if (0 != converter.convert(pSQLChar, len, target))
throw SyntaxException("Error converting UTF-8 to UTF-16");
throw DataFormatException("Error converting UTF-8 to UTF-16");
}
@@ -80,7 +80,7 @@ void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, int length, SQLPOINTER pTarget, SQ
std::string result;
if (0 != converter.convert(buffer.begin(), length * sizeof(SQLWCHAR), result))
throw SyntaxException("Error converting UTF-16 to UTF-8");
throw DataFormatException("Error converting UTF-16 to UTF-8");
std::memset(pTarget, 0, targetLength);
std::strncpy((char*) pTarget, result.c_str(), result.size() < targetLength ? result.size() : targetLength);