not ISOEM(), ISANSI() or IsUTF8()

Re: not ISOEM(), ISANSI() or IsUTF8()

Postby nageswaragunupudi » Sat Sep 02, 2023 3:25 am

to say it again : i need "read" from existing DBF, NOT "made" it from CODE

Yes.
This is what we are very much interested to support you with.
We request you to please send a few thousand records from the existing dbf, instead of a created dbf (say with chr(1) to chr(255))
You may use https://wetransfer.com/. Please send the download link to me and also Mr.Antonio.

"only" DrXlsx LIB need UTF8 where German "Umlaute" fail WHEN it come from German OEM DBF

The version of FWH to be released, will come with an interface to DrXlsx lib. Conversion of AnsiToUtf8 is automatic.
Using FWH methods/functions like :ToExcel() or DbfToExcel() do not require the user to convert data into utf8.

What all the work a programmer needs to do is to set oBrw:lOemAnsi := .t. or oCol:lOemAnsi := .t. for the required columns and then export to Excel. All conversions will be automatically taken care by the FWH interface to DrXlsx.
Hope we can not make it easier than this.

Sample which i used have > 350000 Records but only 0,02 % have "Umlaute"
so i have to "test" every Record / FIELD Type "C" if it have "Umlaute"

This is where we want to support you and request you to share a few thousand records with us. (anywhere between 5000 to 15000)
Even now, you can browse the dbf as it is by setting oBrw:lOemAnsi := .t. and the browse should dislpay the same Umlauts as you see using DBEDIT of Harbour in DOS prompt. In any case, we will have an opportunity to test if you share the data.

Question : did you get Email with Link to "my" DBF :?:

Yes and I will send you the Excel file.

A few points:
The 40 characters from 129 to 168 are treated as OEM and have ANSI equivalents.
There are some OEM characters like some Box characters, etc. which have NO equivaents at all in ANSI and so they can never be displayed in Windows the same way as they appear in DOS.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: not ISOEM(), ISANSI() or IsUTF8()

Postby Jimmy » Sat Sep 02, 2023 11:11 pm

hi,

have send you a new Email with Link
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: not ISOEM(), ISANSI() or IsUTF8()

Postby nageswaragunupudi » Sun Sep 03, 2023 1:17 am

Jimmy wrote:hi,

have send you a new Email with Link


Thanks.
This will help me to learn.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: not ISOEM(), ISANSI() or IsUTF8()

Postby nageswaragunupudi » Sun Sep 03, 2023 7:33 am

Thanks again.
Here is the comparison between
1. Direct OEM view from Command Prompt using Harbour's DBEDIT.
2. FWH XBrowse of the same DBF in ANSI, just by using one flag oBrw:OemAnsi := .t.
3. Excel as exported using DrXlsx by the new FWH interface to this library

All look identical

Image

Conversions from OEM to ANSI and ANSI to UTF8 are all done automatically and correctly by FWH without any code written by the programmer.

Personally I checked all rows and found the translations are correct.

Browsing, editing and modifying OEM databases using FWH XBrowse.
Please do not spend time in writing your own functions. Save time for other things.
What all required is just set this flag
Code: Select all  Expand view
oBrw:lOemAnsi := .t.


Please try this one line code to view the table:
Code: Select all  Expand view
XBROWSER "OEM_LIST.DBF" FASTEDIT SETUP ( oBrw:lOemAnsi := .t. )


We have checked and the OEM to ANSI translations are all correct.
You can also edit, modify and save data through inline cell-edit.
Not only inline-edit, but you can click Add and Edit buttons of XBROWSER window and edit the data.
You see the strings in ANSI, edit and modify in ANSI but XBrowse saves the modifications to the DBF in OEM. You can use the same DBF with you DOS applications like DBEDIT or XBase++

Even you can simultaneously operate the table both with XBase++ and also FWH XBrowse.
I do not have XBase++, but I tried editing simultaneously with DBEDIT of Harbour from command prompt and XBrowse in FWH application.

Note:
Instead of using XBROWSER, if you build your own XBrowse,
(a) just add the setting oBrw:lOemAnsi := .t.
(b) Do not use oBrw:EditSource() but use oBrw:Edit() only.
From next version, you can use either.

When the new version FWH2309 is released, you do not need to any utf8 conversions on your own. FWH will do this conversion while using DrXlsx.

This is the program I used and this program uses the new interface with DrXlsx.
Code: Select all  Expand view
  PreferDrXlsx( .t. )

   DEFINE FONT oFixed NAME "CONSOLAS" SIZE 0,-20

   XBROWSER "\FWH\SAMPLES\OEM_LIST.DBF" SHOW RECID ;
      SETUP ( oBrw:lOemAnsi := .t., ;
              oBrw:SetFont( oFixed ) )

   RELEASE FONT oFixed
 

Just clicked on the Excel button to generate xlsx file using DrXlsx.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: not ISOEM(), ISANSI() or IsUTF8()

Postby Jimmy » Sun Sep 03, 2023 9:42 am

hi,

thx for testing German "Umlaute"

i do not have Problem with XBROWSE, i do have Problem with DrXlsx LIB
When the new version FWH2309 is released, you do not need to any utf8 conversions on your own.
FWH will do this conversion while using DrXlsx.

ok i will wait and try "your" Way from XBROWSER()
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 48 guests

cron