FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with paths with utf8 characters (solved)
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Problem with paths with utf8 characters (solved)
Posted: Fri Nov 29, 2019 09:07 AM
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 (fw): Select all Collapse
#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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with paths with utf8 characters
Posted: Fri Nov 29, 2019 12:16 PM
Massimo, this work for me

Code (fw): Select all Collapse
#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 (fw): Select all Collapse
#include "Fivewin.ch"

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

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

RETURN NIL
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with paths with utf8 characters
Posted: Fri Nov 29, 2019 02:15 PM
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 (fw): Select all Collapse
#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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with paths with utf8 characters
Posted: Fri Nov 29, 2019 02:50 PM

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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with paths with utf8 characters
Posted: Fri Nov 29, 2019 02:54 PM
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?
Regards



G. N. Rao.

Hyderabad, India
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with paths with utf8 characters (solved)
Posted: Fri Nov 29, 2019 03:02 PM

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

Continue the discussion