xsharp.eu • Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer - Page 2
Page 2 of 3

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 7:18 am
by robert
Peter,

The Unicode extension to the fields is only supported for Visual FoxPro compatible tables (the DBFVFP RDD) and you cannot use the OleDb driver for this.
You will have to create the table with DBCreate().
And I just found a problem in 2.19 that causes the Unicode flag to get lost when creating the table.
I'll fix that in the 2.20 release.
After that change you can store various character sets in a DBF like this:

Code: Select all

FUNCTION Start() AS VOID STRICT
    RddSetDefault("DBFVFP")
    System.Console.OutputEncoding = System.Text.Encoding.UTF8
    DbCreate("Polchars.dbf", {{"Name","C:U",100,0},{"Adresse","C:U",100,0}, {"Info","C:U",100,0}})
    DbuseArea(,,"PolChars")
    DbAppend()
    FieldPut(1, "Witaj świecie")  // Polish
    FieldPut(2, "你好世界")  // Chinese
    FieldPut(3, "こんにちは世界") // Japanese
    DbCommit()
    ? FieldGet(1)
    ? FieldGet(2)
    ? FieldGet(3)
    wait

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 7:42 am
by pemo18
This really works,

Many thanks,

Peter

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 8:39 am
by FFF
Robert,
you might consider contacting the Softmaker team (www.softmaker.de), successful producer of a Office clone since the 80ties. They used DBF for their mailmerge etc. and produced relatively recently an unicode version of their dbf interface. Would be cool, if the X# and their variant could be hold compatible... Being no "giant" the folks are very accessable, CEO included ;-)

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 8:48 am
by robert
Karl,
If you own that product, maybe you can create a Unicode DBF and send that to me for inspection?

Robert

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 9:03 am
by pemo18
Hello Robert,

Maybe a caveat, does this works with M fields too? Like M:U?

Right now it looks like these fields do not support Unicode.

Regards,

Peter

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 9:36 am
by robert
Peter,
This does not work yet with Memo fields.
The 'Unicode flag' is handled at the DBF level. Memo fields for FoxPro style tables are stored with the FlexFile driver.
This does not support Unicode, but I can certainly add that for a future build.

Robert

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 9:44 am
by pemo18
>>but I can certainly add that for a future build

If you could to this it would benefit other developers as well.

Or we will decide to drop the dbf files and use SQL Server instead.

Will this the be for X# 2.20?

Kind regards,

Peter

PS: The topic title is a little bit misleading, its about the Hatscheks characters and not only about polish characters.

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 9:54 am
by robert
Peter,
Unicode memos will not make it into 2.20. We are wrapping up 2.20 at this moment.

Robert

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 10:37 am
by pemo18
Of course, but a last question for this topic:

What is the maximum length of a C field?

Maybe we could use it instead of a memo field.

Regards,

Peter

Re: Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Posted: Mon Jun 03, 2024 10:45 am
by robert
Peter,
The maximum length is 65.535 (64K).
However, the length and decimals are stored in a byte field in the DBF header.
Therefore, when the field length of a Character exceeds 255 characters, then the decimals field in the DBF header will be used as well.
In that case, the real length is calculated as Length + Decimals * 256.
This is not new for X#. Clipper already supported that.


Robert