Subject | Re: [firebird-support] UTF8 in Blob, subtype Text & IBObjects |
---|---|
Author | Martijn Tonies |
Post date | 2008-11-18T07:20:33Z |
Hi,
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Sybase
SQL Anywhere, Oracle & MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> >To properly display BLOB subtype Text with UTF8 characters,However, on VARCHAR it works just fine, so what's the deal here?
> >what should be done with regard to fetching blob data and the
> >API?
> >
> >I'm currently using IBObjects which doesn't support this, see:
> >http://tracker.upscene.com/view.php?id=1502&nbn=3#bugnotes
> >
> >Is there something specific IBO should set before fetching the BLOB
> >that it currently only does for varchar data?
>
> I think that text draw problem, not IBO core(or API) problem.
> This case become correct result with e.g. TMS unicode controls.
> It will be possible if unicode controls or ExtTextOutW API.. are used.
> My test code:Martijn Tonies
>
> procedure TForm1.TntButton1Click(Sender: TObject);
> var
> Temp:TStringlist;
> begin
>
> with IB_Connection1 do
> begin
> Params.clear;
> charset := 'NONE'; //IBO 4.8.7: UTF8 charset is using internal ansi
> translation.
> ...
> Path := 'c:\w\test.fdb'; //from your test.fbk
> connect;
> end;
>
> with IB_Cursor1 do
> begin
> SQL.Text := 'select * from test';
>
> Temp:=TStringlist.create;
> try
> First;
> Next; // Second row (german umlaute data)
>
> TIB_ColumnBlob(FieldByName('TEST')).Assignto(Temp);
> TntMemo1.lines.Text := UTF8decode(Temp.Text); //OR
> MultiByteToWideChar
>
> //OR TntMemo1.lines.Text := UTF8decode(FieldByName('TEST').
> Asrawstring);
>
> finally
> Temp.free;
> end;
> end;
> end;
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Sybase
SQL Anywhere, Oracle & MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com