Try to fix broken characters in SHOW CREATE TABLE result by using UTF8StringToWideString(). Fixes issue #1328.

This commit is contained in:
Ansgar Becker
2009-10-28 01:16:29 +00:00
parent aa6e1702fb
commit 8354c106ca
5 changed files with 14 additions and 8 deletions

View File

@ -5,7 +5,7 @@ unit mysql_connection;
interface
uses
Classes, SysUtils, windows, mysql_api, mysql_structures, WideStrings, WideStrUtils;
Classes, SysUtils, windows, mysql_api, mysql_structures, WideStrings, WideStrUtils, cUnicodeCodecs;
type
@ -673,7 +673,7 @@ end;
function TMySQLQuery.Col(Column: Integer; IgnoreErrors: Boolean=False): WideString;
begin
if (Column > -1) and (Column < ColumnCount) then
Result := Utf8Decode(FCurrentRow[Column])
Result := UTF8StringToWideString(FCurrentRow[Column])
else if not IgnoreErrors then
Raise Exception.CreateFmt('Column #%d not available. Query returned %d columns and %d rows.', [Column, ColumnCount, RecordCount]);
end;