MariaDB with latin5_turkish_ci collation

Re: MariaDB with latin5_turkish_ci collation

Postby Horizon » Tue Jun 02, 2020 6:52 pm

Hi Mr. Rao,

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

http://forums.fivetechsupport.com/viewtopic.php?p=71129#p71129

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=14142&start=0&hilit=font

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=12805&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  Expand view
$(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  Expand view
  #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 & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Postby Horizon » Wed Jun 03, 2020 10:18 am

Hi Mr. Rao,

Your revised code :
Code: Select all  Expand view
#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 & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Postby Horizon » Sat Jun 06, 2020 5:53 pm

waiting ....
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Postby nageswaragunupudi » Mon Jun 08, 2020 5:57 am

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  Expand view
#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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MariaDB with latin5_turkish_ci collation

Postby Horizon » Mon Jun 08, 2020 7:40 am

Yes
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: MariaDB with latin5_turkish_ci collation

Postby Horizon » Tue Jun 09, 2020 9:20 am

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 & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests