Page 1 of 1

Problem with paths with utf8 characters (solved)

Posted: Fri Nov 29, 2019 9:07 am
by MaxP
Hi all,

I have a problem with paths with utf8 characters.
In my old version of fivewin the example source below worked,
in the new version does not work.

Code: Select all

#include "Fivewin.ch"

FUNCTION MAIN()
        LOCAL   cNameF := "C:\Conformità\TEST.PDF"

        MsgStop( FILE( cNameF ) )
        MsgStop( FSIZE( cNameF ) )
RETURN NIL
Can someone help me ?

Thanks in advance
Massimo

Re: Problem with paths with utf8 characters

Posted: Fri Nov 29, 2019 12:16 pm
by cnavarro
Massimo, this work for me

Code: Select all

#include "Fivewin.ch"

FUNCTION MAIN()
        LOCAL   cNameF := "E:\Conformitá\TESTHARU.PDF"

   HB_SETCODEPAGE( "UTF8" )
        MsgStop( FILE( cNameF ) )
        MsgStop( FSIZE( cNameF ) )

RETURN NIL
 
and this work also

Code: Select all

#include "Fivewin.ch"

FUNCTION MAIN()
        LOCAL   cNameF := "E:\Conformitá\TESTHARU.PDF"

        MsgStop( FILE( hb_utf8tostr( cNameF ) ) )
        MsgStop( FSIZE( hb_utf8tostr( cNameF ) ) )

RETURN NIL
 

Re: Problem with paths with utf8 characters

Posted: Fri Nov 29, 2019 2:15 pm
by nageswaragunupudi
MaxP wrote:Hi all,

I have a problem with paths with utf8 characters.
In my old version of fivewin the example source below worked,
in the new version does not work.

Code: Select all

#include "Fivewin.ch"

FUNCTION MAIN()
        LOCAL   cNameF := "C:\Conformità\TEST.PDF"

        MsgStop( FILE( cNameF ) )
        MsgStop( FSIZE( cNameF ) )
RETURN NIL
Can someone help me ?

Thanks in advance
Massimo
Both the functions FILE() and FSIZE() are (x)Harbour functions. Not FWH functions. So, behaviour of these functions should not be different with different versions of Fivewin, but they can be different with different versions of (x)Harbour.

I have tested with FWH1301 and the current version and the results are the same.

Can you please indicate which version of FWH you were getting the correct result? We are interested in testing with that version of FWH and see why the results are different.

Re: Problem with paths with utf8 characters

Posted: Fri Nov 29, 2019 2:50 pm
by MaxP
Ok,

I think I understood the problem,
perhaps this information could also be useful to others.

My editor saved data in ASCII format,
and with my old version of fivewin it worked.

With the new version the ASCII format sources produce the error.

Saving data in UTF8 format and adding the HB_SETCODEPAGE( "UTF8" ) instruction now works.

thank you for your time
Massimo

Re: Problem with paths with utf8 characters

Posted: Fri Nov 29, 2019 2:54 pm
by nageswaragunupudi
and with my old version of fivewin it worked
Can you please let us know what is the FWH version it worked? Were you using xHarbour or Harbour?

Re: Problem with paths with utf8 characters (solved)

Posted: Fri Nov 29, 2019 3:02 pm
by MaxP
Old Tools used:
Fivewin 7.01
Harbour 1.0
Borland 5.82

New Tools used:
Fivewin 19.09
Harbour 3.2.0
Borland 5.82