FW_SetUnicode mostrar valor GET con FWINLOG

User avatar
VictorCasajuana
Posts: 30
Joined: Wed Mar 28, 2018 4:38 pm
Location: Vinaròs
Contact:

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by VictorCasajuana »

cnavarro wrote:Look
Image
Ups!, esto es más raro aún, cVar y cGet obtienen valores diferentes cuando pasan por el get sin haber modificado nada en el propio get?
--------
¿ Y porque no ?
¿ And why not ?
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by nageswaragunupudi »

Everything appears to be working perfectly for me here.
This is the program first posted by Mr. Viktor, converted to Source instead of Resource. I have added both cVar and cGet to FWINLOG.

Code: Select all

#include "fivewin.ch"

function Main()

   local oDlg, oGet, oFont, oBtnBmp
   local cVar := 'ñ Ñ a á à ä â A Á À Ä Â e é è ë ê E É È Ë Ê i í ì ï î I Í Ì Ï Î o ó ò ö ô O Ó Ò Ö Ô u ú ù ü û U Ú Ù Ü Û'
   local cGet := cVar

   FW_SetUnicode( .T. )

   FWINLOG cVar

   DEFINE FONT oFont NAME "Calibri" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TRUEPIXEL TITLE cVar FONT oFont

   @ 20,20 GET oGet VAR cGet SIZE 760,24 PIXEL OF oDlg

   oGet:cToolTip := cVar

   @ 60,20 BUTTONBMP oBtnBmp PROMPT cVar SIZE 760,30 PIXEL OF oDlg TOOLTIP cVar

   oBtnBmp:bAction := <||
                           FWINLOG cVar, cGet
                           MsgInfo(cVar)
                           return Nil
                      >

   ACTIVATE DIALOG oDlg CENTER
   RELEASE FONT oFont

return nil
 
Image

Both cVar and cGet are displayed correctly. I do not understand why is it not working for you there.

Can you please build and run this program with buildh.bat?
Regards

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

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by nageswaragunupudi »

Next, I tried with resources:

Code: Select all

#include "fivewin.ch"

function Main()

    local oDlg, oGet
    local cVar := 'ñ Ñ a á à ä â A Á À Ä Â e é è ë ê E É È Ë Ê i í ì ï î I Í Ì Ï Î o ó ò ö ô O Ó Ò Ö Ô u ú ù ü û U Ú Ù Ü Û'
    local cGet := cVar
    local oBtnBmp

    FW_SetUnicode( .T. )

    FWINLOG cVar

    DEFINE DIALOG oDlg;
           Resource "dialogo";
           Title cVar

    Redefine Get oGet;
             Var cGet;
             Id 4004;
             Of oDlg

    oGet:cToolTip := cVar

    Redefine ButtonBmp oBtnBmp ;
             Id 4003 Of oDlg;
             Prompt cVar ;
             ToolTip cVar

    oBtnBmp:bAction := <||
                            FWINLOG cVar, cGet, cVar == cGet
                            MsgInfo(cVar)
                            Return Nil
                       >

    ACTIVATE DIALOG oDlg CENTER

return nil
 
Image

Everything looks working correctly.
Please help me to understand what am I missing? Why are you getting incorrect results?
Regards

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

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by nageswaragunupudi »

Now, let us test MySql Unicode issues:

This is a generic program to test working with Unicode (utf8) on MySql server.
For this sample, I used a cloud server that is available to all of us, so that you can build this sample without changing the server address.

Code: Select all

#include "fivewin.ch"

REQUEST HB_LANG_ESWIN
REQUEST HB_CODEPAGE_ESWIN

//----------------------------------------------------------------------------//

function Main()

   local oCn, oRs, oDlg, oFont, aData, cSql

   FW_SetUnicode( .t. )

   HB_CDPSELECT("ESWIN")
   HB_LangSelect( "ES" )


   aData := { { "KOREAN", Space( 20 ) }, { "CHINESE", Space( 20 ) }, ;
              { "TELUGU", Space( 20 ) }, { "HINDI",   Space( 20 ) }, ;
              { "SPANISH",Space( 20 ) } }

   FWCONNECT oCn HOST "208.91.198.197:3306" USER "gnraofwh" PASSWORD "Bharat@1950" DATABASE "fwhdemo" PORT "3306"
   if oCn == nil
      return nil
   endif

   oCn:DropTable( "utftest3" )
   if !oCn:TableExists( "utftest3" )
      oCn:CreateTable( "utftest3", { { "lang", "C", 10, 0, "PRI" }, { "text", "C", 20, 0, "utf8" } }, .f., "utf8" )
      ? oCn:CreateTableSQL( "utftest3" )
   endif

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,300 PIXEL TRUEPIXEL FONT oFont

   @  20,20 SAY "KOREAN " GET aData[ 1, 2 ] SIZE 340,22 PIXEL OF oDlg CHRGROUP CHR_WIDE
   @  50,20 SAY "CHINESE" GET aData[ 2, 2 ] SIZE 340,22 PIXEL OF oDlg CHRGROUP CHR_WIDE
   @  80,20 SAY "TELUGU " GET aData[ 3, 2 ] SIZE 340,22 PIXEL OF oDlg CHRGROUP CHR_WIDE
   @ 110,20 SAY "HINDI  " GET aData[ 4, 2 ] SIZE 340,22 PIXEL OF oDlg CHRGROUP CHR_WIDE
   @ 140,20 SAY "SPANISH" GET aData[ 5, 2 ] SIZE 340,22 PIXEL OF oDlg CHRGROUP CHR_WIDE

   @ 200,20 BUTTON "SAVE AND SHOW" SIZE 150,40 PIXEL OF oDlg ACTION ( ;
         oCn:Insert( "utftest3", "lang,text", aData, .t. ), ;
         XBrowse( oRs := oCn:utftest3 ), ;
         oRs:Close() )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   oCn:Close()

return nil

//----------------------------------------------------------------------------//
 
Image

I have used the FWH built-in MySql library that comes free along with FWH library and at the same time much better and simpler to use than others including ADO.

I do not find any problem with any Unicode language.
Regards

G. N. Rao.
Hyderabad, India
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by cnavarro »

Please try same sample with FWLOG ( and notepad )
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by nageswaragunupudi »

Mr. Cristobal

I added FWLOG:

Code: Select all

   oBtnBmp:bAction := <||
                           FWINLOG cVar, cGet, cVar == cGet
                           FWLOG cVar, cGet, cVar == cGet
                           MsgInfo(cVar)
                           return Nil
                      >
 
This is the notepad.exe:
Image

I have already tested this extensively.
I request you to build and run this program with buildh.bat in the samples folder:

Code: Select all

#include "fivewin.ch"

function Main()

   local oDlg, oGet, oFont, oBtnBmp
   local cVar := 'ñ Ñ a á à ä â A Á À Ä Â e é è ë ê E É È Ë Ê i í ì ï î I Í Ì Ï Î o ó ò ö ô O Ó Ò Ö Ô u ú ù ü û U Ú Ù Ü Û'
   local cGet := cVar
   local cLog := cFileSetExt( ExeName(), "log" )

   FW_SetUnicode( .T. )
   FErase( cLog )

   FWINLOG cVar

   DEFINE FONT oFont NAME "Calibri" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TRUEPIXEL TITLE cVar FONT oFont

   @ 20,20 GET oGet VAR cGet SIZE 760,24 PIXEL OF oDlg

   oGet:cToolTip := cVar

   @ 60,20 BUTTONBMP oBtnBmp PROMPT cVar SIZE 760,30 PIXEL OF oDlg TOOLTIP cVar

   oBtnBmp:bAction := <||
                           FWINLOG cVar, cGet, cVar == cGet
                           FWLOG cVar, cGet, cVar == cGet
                           MsgInfo(cVar)
                           return Nil
                      >

   ACTIVATE DIALOG oDlg CENTER
   RELEASE FONT oFont

   WinExec( "notepad.exe " + cLog )

return nil
 
Regards

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

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by nageswaragunupudi »

Here is the proof that FWH is working correctly:

Image

Now, please test this at your end and find out the cause of error at your end. Please build the sample in the samples folder with buildh.bat
Regards

G. N. Rao.
Hyderabad, India
User avatar
VictorCasajuana
Posts: 30
Joined: Wed Mar 28, 2018 4:38 pm
Location: Vinaròs
Contact:

Re: FW_SetUnicode mostrar valor GET con FWINLOG

Post by VictorCasajuana »

nageswaragunupudi wrote:Everything appears to be working perfectly for me here.
This is the program first posted by Mr. Viktor, converted to Source instead of Resource. I have added both cVar and cGet to FWINLOG.

Both cVar and cGet are displayed correctly. I do not understand why is it not working for you there.

Can you please build and run this program with buildh.bat?
Thank you for your time.
I compiled his example with buildh.bat and the result is even stranger...
Image
--------
¿ Y porque no ?
¿ And why not ?
Post Reply