diff --git a/Data/ODBC/include/Poco/Data/ODBC/Unicode_UNIXODBC.h b/Data/ODBC/include/Poco/Data/ODBC/Unicode_UNIXODBC.h index 1e4323641..69102562b 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Unicode_UNIXODBC.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Unicode_UNIXODBC.h @@ -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& 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& 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); } diff --git a/Data/ODBC/src/Unicode_UNIXODBC.cpp b/Data/ODBC/src/Unicode_UNIXODBC.cpp index 3ff56c644..6d73706b1 100644 --- a/Data/ODBC/src/Unicode_UNIXODBC.cpp +++ b/Data/ODBC/src/Unicode_UNIXODBC.cpp @@ -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& 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);