MS SQL + Delphi not the correct codepage

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
mikola123
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 23.08.2011, 14:04

MS SQL + Delphi not the correct codepage

Post by mikola123 »

Dear sirs,
I'm using MS SQL with Cyrillic_General (cp1251) encoding and Delphi. When I'm going to select data, everything works fine, but the update results in writing badly encoded characters in DB. I'm already tried to use codepage=win, codepage=win1251, codepage=cp1251 (and tried the same with codepage_client). Trace shows that query arrives to the DB with already broken chars.

Example query on trace:

update tblEmployee set first_name='Николай' where empl_id=2
mikola123
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 23.08.2011, 14:04

Post by mikola123 »

found here
module ZDbcDbLibStatement, line 213

if FPlainDriver.dbcmd (FHandle, PAnsiChar (UTF8Encode (SQL))) <> DBSUCCEED then
mikola123
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 23.08.2011, 14:04

Post by mikola123 »

I decided to do so
if FPlainDriver.dbcmd (FHandle, PAnsiChar (AnsiString (SQL))) <> DBSUCCEED then

It Works!
Locked