Problem with paths with utf8 characters (solved)

Post Reply
User avatar
MaxP
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm
Contact:

Problem with paths with utf8 characters (solved)

Post 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
Last edited by MaxP on Fri Nov 29, 2019 2:54 pm, edited 1 time in total.
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with paths with utf8 characters

Post 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
 
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: Problem with paths with utf8 characters

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
MaxP
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm
Contact:

Re: Problem with paths with utf8 characters

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with paths with utf8 characters

Post 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?
Regards

G. N. Rao.
Hyderabad, India
User avatar
MaxP
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm
Contact:

Re: Problem with paths with utf8 characters (solved)

Post 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
Post Reply