A question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

A question

Zoran Sibinovic
Hi to all,

I've been studying for some time how the Firibird works.

But I found some problems by using diff charsets

We have a .fdb - UTF8 base and ALL the tables fields defined also with UTF8. Windows is localized to Serbian cyrillic. The data is entered using some custom app using SR cyrillic from the right-bottom language bar, the app is written in MS Visual C++ which source I don't have to analyze. 

Analizing the results with Flamerobin the results are: all the fields are filled with data in UTF8, but the blobs data is coded in WIN1251, also, setting UTF8 as default conn charset, all the data are been displayed ok except blobs data. On the other site, setting to WIN1251 as default charset, the fields and the blos data become displayed fine, but this is only an illusion, because the data in the fields are still in UTF8 and the blobs remains in WIN1251, just a fine display.

So I have tried to investigate this behavior.
I have exported the table data from flamerobin in a .cvs, and got a file written in UTF8. Seems normal considering that the .fdb is created with UTF8. 
I putted then, trough my app, the data in a .dbf, translated them back reading the .dbf to UTF8 and enrolled them back in the .fdb.

Everything is fine, now also the blobs are visible with the default UTF8 charset, but, the custom app didn't display the blobs text data properly as it is expecting data coded in WIN1251. I suppose that, since the .fdb is created with UTF8, any "UPDATE..." statement, process only data identified in the default charset.

So, my question is:
It is possible to write in a .fdb, with a predefined charset, trough flamerobin statements or functions (UPDATE...,  UPPER() ...), data with different charset, because the execution returns an error or no changes? 

Thanks

Zoran



------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question

Michael Hieke
On 27.10.2012 09:57, Zoran Sibinovic wrote:

> I've been studying for some time how the Firibird works.
>
> But I found some problems by using diff charsets

These are questions better suited to the Firebird support list, where
you can ask specific questions. Looking into CAST() and charset
introducer syntax would probably be a good start.

Thanks

--
Michael Hieke


------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question

Milan Babuskov-4
In reply to this post by Zoran Sibinovic
On Sat, Oct 27, 2012 at 9:57 AM, Zoran Sibinovic
<[hidden email]> wrote:
> Analizing the results with Flamerobin the results are: all the fields are
> filled with data in UTF8, but the blobs data is coded in WIN1251

What is exact DDL for BLOB column?

--
Milan Babuskov
http://www.guacosoft.com

------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question

Zoran Sibinovic
In reply to this post by Zoran Sibinovic
Hi Michael, Milan,

I use Firebird 2.5.1 and the latest Flamerobin snapshot and this post refers only for text blobs.

I agree that some questions is better to make to Firebird, but since Flamerobin is a managing tool foir it, I must say very powerful, I supposed that this case can be of interest for the developers, so I post this question here because I think that exist a good number of people that face the same problem.

I've noticed also that editing the blob field using   in browse -> right-click -> Edit option, in the 2 latest snapshots, can be now readable also If the data is written in different charsets, but according some rules, after made changes of text in the edit window Firebird translate and put the data in the base-defined charset, it not leave the data in the original written charset. This is how the thing have to work but If someone use different charsts to fill the blobs trough some app, and than try, using some managing tools like Flamerobin, to make some large operations on the base the things become messy.  I've tried lot of alternative tools to overcome this problem and found none that can do that. I've read lot of texts of similar problems but none have a finally solution even in the Firebird explanations. As Michael said to have to try with CAST, I have tried almost a month ago, just Flamereobim said that no such command or function is recognized.

I have to remark that this problem refers only to blobs. It not apply to other types of fields that works although have written data in different charsets.

Thanks
Zoran 

------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question

Milan Babuskov-4
In reply to this post by Zoran Sibinovic
On Sat, Oct 27, 2012 at 9:57 AM, Zoran Sibinovic
<[hidden email]> wrote:
>The data is entered using some
> custom app using SR cyrillic from the right-bottom language bar, the app is
> written in MS Visual C++ which source I don't have to analyze.

Re-reading the rest of your original post, it seems to me that problem
lies in this application and not Firebird. Maybe the app is treating
the blob column like it's just a binary field and dumps data without
transliteration.

I'm not sure FlameRobin can help you, since it only translates from
connection character set to Windows native charset. When you set
connection character set to WIN1251 no transliteration is done, so you
get whatever Firebird returns. Firebird OTOH transliterates from the
stored character set given in column definition to connection
character set supplied when connecting to database. This is why I
asked for exact DDL for blob column to see if it's maybe defined as
character set NONE or maybe SUBTYPE 0. It that is not the case, then
there is not much we can do, the problem lies in the application.

--
Milan Babuskov
http://www.guacosoft.com

------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Flamerobin-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/flamerobin-devel