different codepage or font issue ??
-
- Posts: 26
- Joined: Thu Jan 28, 2010 3:23 am
different codepage or font issue ??
Hi,
I am converting foreign data from excel into DBF ( namely arabic ) . Now Advantage Data Architect reads the dbf file correctly ( ansi ), while Xdbu is not. Any hint about this issue ? How can I make the same file readable in Xbase ? is this a code page issue where can it be set ?
Regards
I am converting foreign data from excel into DBF ( namely arabic ) . Now Advantage Data Architect reads the dbf file correctly ( ansi ), while Xdbu is not. Any hint about this issue ? How can I make the same file readable in Xbase ? is this a code page issue where can it be set ?
Regards
- Attachments
-
- file read in advantage
- Advantage.jpg (18.35 KiB) Viewed 15510 times
-
- file read in ( Xdbu ) Xbase
- xbase.jpg (31.71 KiB) Viewed 15510 times
-
- Posts: 26
- Joined: Fri Mar 04, 2011 7:35 am
- Location: San Bernardino, CA USA
- Contact:
Re: different codepage or font issue ??
Why not try the simple route use a second field that has a translated name?
-
- Posts: 26
- Joined: Thu Jan 28, 2010 3:23 am
Re: different codepage or font issue ??
Hi,
What do you mean by a second field that has a "translated name" ?
Regards
What do you mean by a second field that has a "translated name" ?
Regards
Re: different codepage or font issue ??
not shure about arabic while i use chinese Signpierredaou wrote:How can I make the same file readable in Xbase ? is this a code page issue where can it be set ?
your 2nd Picture show a normal DBU using some "local System" Font which does not "match".
so use some Code like this to change Font "on-fly" in a Browse.
Code: Select all
oBrowse:itemRbDown := {| aMousePos, aRowCol, oSelf | ;
ChangeFont(aRowCol, oSelf) }
PROCEDURE ChangeFont(aRowCol,oBrowse)
LOCAL oFontDlg
LOCAL oFnt
LOCAL nPosi := aRowCol[2]
LOCAL OldFnt := oBrowse:GetColumn(nPosi):dataArea:setFont()
oFontDlg := XbpFontDialog():new(oBrowse) // Objekt erzeugen
oFontDlg:familyName := OldFnt:familyName
// Font-Dialog konfigurieren
oFontDlg:create() // Dialog anfordern
oFnt := oFontDlg:display() // Dialog aktivieren
IF oFnt <> NIL
MSGBOX("Font :"+LTRIM(STR(oFnt:nominalPointSize))+"."+;
oFnt:compoundName+CHR(13)+" Codepage :"+;
LTRIM(STR(oFnt:codePage)) )
oBrowse:GetColumn(nPosi):dataArea:setFont(oFnt)
oBrowse:refreshall()
ENDIF
oFontDlg:destroy()
RETURN
for more Informationen see Alaska Newsgroup
public.xbase++.generic
Mixing ANSI/ASCII and Unicode
Philip Jackson
21. Mai 2011
greetings by OHR
Jimmy
Jimmy
-
- Posts: 26
- Joined: Thu Jan 28, 2010 3:23 am
Re: different codepage or font issue ??
thank you, I will try this.
-
- Posts: 26
- Joined: Thu Jan 28, 2010 3:23 am
Re: different codepage or font issue ??
Hi again,
it is not a matter of fonts, it is a matter of codepage. How can we set a default codepage in Xbase.
Regards
it is not a matter of fonts, it is a matter of codepage. How can we set a default codepage in Xbase.
Regards
Re: different codepage or font issue ??
only Font have Codepage which you can set.pierredaou wrote:it is not a matter of fonts, it is a matter of codepage. How can we set a default codepage in Xbase.
using FontDialog you have to open ComboBox ( see Picture ) Note : i use OEM so perhaps you have to use ConvToOemCP() to "convert back"
greetings by OHR
Jimmy
Jimmy
-
- Posts: 26
- Joined: Thu Jan 28, 2010 3:23 am
Re: different codepage or font issue ??
Hi Jimmy, thank you and sorry for my late reply.
Still at point 0. Again, how can you invoke the FontDialog inside you PRG ( in a DCget for example ) "using all the installed fonts you have inside Windows".
Regards
Still at point 0. Again, how can you invoke the FontDialog inside you PRG ( in a DCget for example ) "using all the installed fonts you have inside Windows".
Regards
Re: different codepage or font issue ??
sorry i´m not a Express++ User so i can´t say about DC* Function.pierredaou wrote:Hi Jimmy, thank you and sorry for my late reply.
Still at point 0. Again, how can you invoke the FontDialog inside you PRG ( in a DCget for example ) "using all the installed fonts you have inside Windows".
i use Xbase++ itemRbDown Slot in XbpBrowse
with :getColumn( <nColPos> ) --> oXbpColumn.
after this i call Fontdialog and set it to oXbpColumn.
you have to "set-up" Font to every Columne after :addColumn()
Code: Select all
imax := FCount()
aStruct := DbStruct()
FOR i:=1 TO imax
IF .NOT. aStruct[i,2] $ "BOVTXY"
oBrowse:addColumn( FieldBlockTrimmed(aStruct[i,1], aStruct[i,2]), , aStruct[i,1] )
ENDIF
NEXT
i := 0
FOR i := 1 TO imax
DO CASE
CASE i = 1
oBrowse:GetColumn( 1 ) :dataArea:setFont( oFnt1 )
CASE i = 2
IF ID_CHINA
oBrowse:GetColumn( 2 ) :dataArea:setFont( oFnt2 ) // second font
ELSE
oBrowse:GetColumn( 2 ) :dataArea:setFont( oFnt1 )
ENDIF
CASE i = 3
oBrowse:GetColumn( 3 ) :dataArea:setFont( oFnt1 )
CASE i = 4
IF ID_CHINA
oBrowse:GetColumn( 4 ) :dataArea:setFont( oFnt1 )
ELSE
oBrowse:GetColumn( 4 ) :dataArea:setFont( oFnt2 ) // second font
ENDIF
ENDCASE
NEXT
now you can use itemRbDown Slot this Way
Code: Select all
...
oBrowse:itemRbDown := {| aMousePos, aRowCol, oSelf | ;
ChangeFont(aRowCol, oSelf) }
...
PROCEDURE ChangeFont(aRowCol,oBrowse)
LOCAL oFontDlg
LOCAL oFnt
LOCAL nPosi := aRowCol[2]
LOCAL OldFnt
LOCAL bSaveError := ERRORBLOCK( { | oError | BREAK( oError ) } )
//
// if no Font have been set before, it will CRASH here !!!
//
BEGIN SEQUENCE
OldFnt := oBrowse:GetColumn(nPosi):dataArea:setFont()
RECOVER USING oError
ERRORBLOCK( bSaveError )
msgbox("not FONT Object set to Columne before","Error old Font")
RETURN
END SEQUENCE
ERRORBLOCK( bSaveError )
oFontDlg := XbpFontDialog():new(oBrowse) // Objekt erzeugen
oFontDlg:familyName := OldFnt:familyName
// Font-Dialog konfigurieren
oFontDlg:create() // Dialog anfordern
oFnt := oFontDlg:display() // Dialog aktivieren
IF oFnt <> NIL
MSGBOX("Font :"+LTRIM(STR(oFnt:nominalPointSize))+"."+;
oFnt:compoundName+CHR(13)+" Codepage :"+;
LTRIM(STR(oFnt:codePage)) )
oBrowse:GetColumn(nPosi):dataArea:setFont(oFnt)
oBrowse:refreshall()
ENDIF
oFontDlg:destroy()
RETURN
greetings by OHR
Jimmy
Jimmy