Verwenden polnischer Zeichen in einer Dbf-Datei mit DBServer

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
pemo18
Posts: 81
Joined: Fri Apr 27, 2018 10:38 am
Location: Germany

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

Post by pemo18 »

This really works,

Many thanks,

Peter
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

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

Post 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 ;-)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post by robert »

Karl,
If you own that product, maybe you can create a Unicode DBF and send that to me for inspection?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
pemo18
Posts: 81
Joined: Fri Apr 27, 2018 10:38 am
Location: Germany

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

Post 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
Last edited by pemo18 on Mon Jun 03, 2024 10:38 am, edited 1 time in total.
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
pemo18
Posts: 81
Joined: Fri Apr 27, 2018 10:38 am
Location: Germany

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

Post 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.
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post by robert »

Peter,
Unicode memos will not make it into 2.20. We are wrapping up 2.20 at this moment.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
pemo18
Posts: 81
Joined: Fri Apr 27, 2018 10:38 am
Location: Germany

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

Post 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
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply