View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036481 | Lazarus | LazUtils | public | 2019-12-26 14:27 | 2020-01-03 10:25 |
Reporter | Ondrej Pokorny | Assigned To | Ondrej Pokorny | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.1 (SVN) | ||||
Target Version | 2.2 | ||||
Summary | 0036481: ANSI ODBC regression - strings are read in wrong encoding | ||||
Description | r61976 changed ANSI GetStandardCodePageProc result. Now it is UTF-8 in Lazarus and not WIN-ANSI. As a result, all ANSI strings that are read from 3rd party libraries and interfaces are corrupt. | ||||
Steps To Reproduce | See the attached project. Compile with FPC trunk because it has ODBC encoding fixes that are not present in FPC stable. | ||||
Additional Information | r61976 broke this. Before r61976 the result was correct. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 62474 | ||||
LazTarget | - | ||||
Widgetset | |||||
Attached Files |
|
related to | 0036480 | closed | Ondrej Pokorny | TEncoding.ANSI regression - it's UTF-8 now in Lazarus |
|
|
|
ODBCTest.lpr (892 bytes)
program ODBCTest; uses LazUTF8, DB, odbcconn, SQLDB; var xConn: TODBCConnection; Q: TSQLQuery; T: TSQLTransaction; S: string; U: UnicodeString; begin xConn := TODBCConnection.Create(nil); xConn.HostName := 'SQLSERVER'; xConn.DatabaseName := xConn.HostName; xConn.Driver := 'SQL Server Native Client 11.0'; xConn.Connected := True; T := TSQLTransaction.Create(xConn); xConn.Transaction := T; Q := TSQLQuery.Create(xConn); Q.SQLConnection := xConn; Q.Transaction := T; U := 'SELECT ''äöüß'''; S := AnsiString(UnicodeString(U)); Q.SQL.Text := S; Writeln('UnicodeString input: ', U); Writeln('String input: ', S); Writeln('Q.SQL.Text: ', Q.SQL.Text); Q.Open; Writeln('UnicodeString Output: '+Q.Fields[0].AsWideString); Writeln('String Output: '+Q.Fields[0].AsString); ReadLn; xConn.Free; end. |
|
Isn't this caused by the same reason you mentioned in 0036480? |
|
@Bart: yes. In both reports I document r61976 as the reason. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-12-26 14:27 | Ondrej Pokorny | New Issue | |
2019-12-26 14:27 | Ondrej Pokorny | File Added: ODBC-regression.png | |
2019-12-26 14:28 | Ondrej Pokorny | File Added: ODBCTest.lpr | |
2019-12-26 15:50 | Bart Broersma | Relationship added | related to 0036480 |
2019-12-26 15:51 | Bart Broersma | Note Added: 0120072 | |
2019-12-26 15:54 | Ondrej Pokorny | Note Added: 0120073 | |
2020-01-03 10:25 | Ondrej Pokorny | Assigned To | => Ondrej Pokorny |
2020-01-03 10:25 | Ondrej Pokorny | Status | new => assigned |
2020-01-03 10:25 | Ondrej Pokorny | Status | assigned => resolved |
2020-01-03 10:25 | Ondrej Pokorny | Resolution | open => fixed |
2020-01-03 10:25 | Ondrej Pokorny | Fixed in Revision | => 62474 |
2020-01-03 10:25 | Ondrej Pokorny | LazTarget | => - |
2020-01-03 10:25 | Ondrej Pokorny | Status | resolved => closed |