Problem with paths with utf8 characters (solved)

Problem with paths with utf8 characters (solved)

Postby MaxP » Fri Nov 29, 2019 9: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: Select all  Expand view
#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
Last edited by MaxP on Fri Nov 29, 2019 2:54 pm, edited 1 time in total.
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with paths with utf8 characters

Postby cnavarro » Fri Nov 29, 2019 12:16 pm

Massimo, this work for me

Code: Select all  Expand view

#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  Expand view

#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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with paths with utf8 characters

Postby nageswaragunupudi » Fri Nov 29, 2019 2: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: Select all  Expand view
#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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with paths with utf8 characters

Postby MaxP » Fri Nov 29, 2019 2: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
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with paths with utf8 characters

Postby nageswaragunupudi » Fri Nov 29, 2019 2: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with paths with utf8 characters (solved)

Postby MaxP » Fri Nov 29, 2019 3: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
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Jimmy and 89 guests