MariaDB with latin5_turkish_ci collation

Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Post by Horizon »

Hi Mr. Rao,

You may need to take a look at the topics below before you can understand me.

http://forums.fivetechsupport.com/viewt ... 129#p71129

http://forums.fivetechsupport.com/viewt ... hilit=font

http://forums.fivetechsupport.com/viewt ... hilit=font


In summary, in order to see the Turkish character set in my application, the nCharSet variable in font.prg must be 1.

In every fwh version, I compile font.prg as below and add it to my own application.

Code: Select all

$(OBJDIR)\font.c                : $(FWDIR)\source\classes\font.prg
        $(HBDIR)\bin\harbour $(FWDIR)\source\classes\font.prg /n \
        /i$(FWDIR)\include;$(HBDIR)\include /d_DEFAULT_CHARSET_=1 /o$(OBJDIR)\font.c
There is line new method in font.prg from fwh\source\classes.

Code: Select all

   #ifdef __XPP__
      #undef New
   #endif

   #ifdef _DEFAULT_CHARSET_
      DEFAULT nCharSet := _DEFAULT_CHARSET_
   #endif

   DEFAULT cFaceName := "SYSTEM_FONT", nEscapement := 0, nOrientation := 0, nWeight := 0,;
           nHeight := 14, lItalic := .f., lFromUser := .f., lUnderLine := .f.,;
           lStrikeOut := .f., nCharSet := 0, nOutPrecision := 0,;
           nClipPrecision := 0, nQuality := 0, lBold := .f., nWidth := 0,;
           nPitchFamily := 0, ::nCount := 0, ::lDestroy := .t., aFonts := {}
so, I have added to font.obj to your code and compiled. Result is.Image
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Post by Horizon »

Hi Mr. Rao,

Your revised code :

Code: Select all

#include "fivewin.ch"

REQUEST DBFCDX
REQUEST HB_CODEPAGE_TRWIN

static oCn

function Main()

    local cDbf     := "turkish\smssblon.dbf"
    local cTable   := cFileNoExt( cDbf )
    local cObj_Charset := "latin5_turkish_ci"

    FW_SetUnicode( .f. )

    oCn := FW_DemoDB()
    if oCn == nil
      ? "Connnect Fail"
      return nil
    endif
    ? oCn:cServerInfo

    if oCn:TableExists( cTable )
      oCn:DropTable( cTable )
    endif
    if oCn:TableExists( "latin5" )
      oCn:DropTable( "latin5" )
    endif   
    
    oCn:ImportFromDbf( cDbf )       // latin1
  oCn:ImportFromDbf( cDbf,"latin5",,,,,cObj_Charset )

    XBROWSER cDbf NOMODAL slnum 

    XBROWSER oCn:ListColumns( 'smssblon') nomodal TITLE "latin1_swedish_ci"
    XBROWSER oCn:smssblon slnum nomodal TITLE "FWMARIAROWSET - latin1_swedish_ci"

    XBROWSER oCn:ListColumns( 'latin5') nomodal TITLE cObj_Charset
    XBROWSER oCn:latin5 slnum TITLE "FWMARIAROWSET - "+cObj_Charset

    oCn:Close()

return nil
Image
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Post by Horizon »

waiting ....
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: MariaDB with latin5_turkish_ci collation

Post by nageswaragunupudi »

nageswaragunupudi wrote:I have imported the above dbf to mysql with this program.
XBrowse of the MySql matches with the xbrowse of the dbf.
I do not find any ?? in the display.

I did not set FW_SetUnicode( .t. ).
So, this is not a Unicode application.

Code: Select all

#include "fivewin.ch"

REQUEST DBFCDX
REQUEST HB_CODEPAGE_TRWIN

static oCn

function Main()

   local cDbf     := "turkish\smssblon.dbf"
   local cTable   := cFileNoExt( cDbf )

   HB_CDPSELECT( "TRWIN" )

   RDDSETDEFAULT( "DBFCDX" )

   oCn := FW_DemoDB()
   if oCn == nil
      ? "Connnect Fail"
      return nil
   endif
   ? oCn:cServerInfo
   if oCn:TableExists( cTable )
      oCn:DropTable( cTable )
   endif
   oCn:ImportFromDbf( cDbf )

   XBROWSER cDbf NOMODAL
   XBROWSER oCn:smssblon

   oCn:Close()

return nil
Image

I do not see any problem.
Can you please help me to understand "step by step"?

My first question:

Is the text and characters displayed in the above browse are correct and valid Turkish text and characters or not?

Kindly answer me "Yes" or "No"

After your brief answer I will come up with my other doubts.
Regards

G. N. Rao.
Hyderabad, India
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Post by Horizon »

Yes
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Post by Horizon »

Hi Mr. Rao,

I try to use "latin1_swedish_ci" and it seems there is not any problem with turkish characters.

There may be a converting charset problem in Importfromdbf method.

For example, I try to use "utf8_turkish_ci" and there is "?" problem in my application both fw_SetUnicode function .t. or .f.. after that I convert again with Importfromdbf method to mariadb using "latin1_Swedish_ci". than I convert tables collation to "utf8_turkish_ci" in HeidiSQL. There is not any "?" character problem.

I think there is a problem like this converting to "latin5_turkish_ci".
There is not any read problem in fw mariadb. The origin is incorrect data.

I think I have solved my problem using "latin1_swedish_ci" for now. I hope there is not sorting problems.

Thanks for effort.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Post Reply