error special Filename characters

75 views
Skip to first unread message

nnicanor

unread,
Jun 11, 2012, 8:58:15 PM6/11/12
to Harbour Developers
With las version of HARBUR (BCC, MVC & MINGW) when using special
characters to create filenames all special are changed and get error
when try to open because special characters changed, i return to
previus version of HARBOUR 7025 for Bcc y Mvc y 17003 for mingw

Example:

cFilename :="PÓLIZA DIRECTORES Y ADMINISTRADORES.pdf"

oQryFind = TDolphinQry():New( "select file from files where id="
+ ClipValue2Sql( uValue ), oQry:oServer )

nHandle := FCreate( cFilename )

IF FError() # 0
MsgInfo( "Error grabando Archivo " + AllTrim( cfilename ) )
RETURN
ENDIF

FWrite( nHandle, oQryFind:file, Len( oQryFind:file ) )
FClose( nHandle )

// memowrite( cFilename, oQryFind:file ) // Same error

ShellExecute(,"Open","'"+cFilename+"'",,,3) // can't not open
file because created filename have changed characters

Created name is "P╙LIZA DIRECTORES Y ADMINISTRADORES.pdf" where Ó is
changed for ╙ and same is for all branded characters and Ñ y ñ.

Please notify to harbour team to review.


Slds,

Massimo Belgrano

unread,
Jun 12, 2012, 9:40:30 AM6/12/12
to harbou...@googlegroups.com
   Always evaluate these points before reporting an issue on the developers'
   mailing list. (from install official by Viktor) 
   -  If you are to report a problem with Harbour itself, always provide
       self-contained, minimal source code example. Do not use xhb contrib
       library, or any 3rd party Harbour libraries. The example shall reproduce
       the problem using official stable or nightly Harbour build.
       Do not post executables and other binary files.
       See more on self-contained examples: http://sscce.org/


FUNC MAIN
    cFilename :="PÓLIZA DIRECTORES Y ADMINISTRADORES.TXT"

    nHandle := FCreate( cFilename  )
     IF FError() # 0
        MsgInfo( "Error with  " + AllTrim( cfilename ) )
        RETURN
     ENDIF
     FWrite( nHandle, "Hello"+chr(13)+chr(10))
     ShellExecute(,"Open","'"+cFilename+"'",,,3) // can't not open file because created filename 
     // have  changed characters
     FClose( nHandle )
  RETURN NIL

2012/6/12 nnicanor <nicanor....@gmail.com>



--
Massimo Belgrano

Nicanor Martinez Martinez

unread,
Jun 12, 2012, 2:32:59 PM6/12/12
to harbou...@googlegroups.com
This is correct sample, browse files after run and see filename created.

 FUNC MAIN()

Local    cFilename :="PÓLIZA DIRECTORES Y ADMINISTRADORES.TXT"

    nHandle := FCreate( cFilename  )
     IF FError() # 0
        MsgInfo( "Error with  " + AllTrim( cfilename ) )
        RETURN
     ENDIF

     FWrite( nHandle, "Hello"+chr(13)+chr(10))
     FClose( nHandle )

  RETURN NIL

Thanks,

Nicanor

2012/6/12 Massimo Belgrano <mbel...@deltain.it>

Nicanor Martinez Martinez

unread,
Jun 13, 2012, 2:18:16 PM6/13/12
to harbou...@googlegroups.com
Any nees about issue ?

Regards,
Nicanor



2012/6/12 Nicanor Martinez Martinez <nicanor....@gmail.com>

Nicanor Martinez Martinez

unread,
Jun 13, 2012, 2:20:51 PM6/13/12
to harbou...@googlegroups.com
Excusme,

Any news ?

Regards,

Nicanor

2012/6/13 Nicanor Martinez Martinez <nicanor....@gmail.com>

Przemysław Czerpak

unread,
Jun 13, 2012, 3:08:23 PM6/13/12
to harbou...@googlegroups.com
Hi,

Similar questions was asked many times recently.
This is the last time I'm answering for it.
You have to inform HVM what encoding you are using:
REQUEST HB_CODEPAGE_<yourcp>
SET( _SET_CODEPAGE, "<yourcp>" )
where <yourcp> is then name of your codepage.

best regards,
Przemek

Massimo Belgrano

unread,
Jun 13, 2012, 3:17:28 PM6/13/12
to harbou...@googlegroups.com
REQUEST HB_LANG_ES
REQUEST HB_CODEPAGE_ES850C
 FUNC MAIN()
    Local    cFilename :="PÓLIZA DIRECTORES Y ADMINISTRADORES.TXT"
    SET( _SET_CODEPAGE, "ES850>" )
    ? cFilename
    nHandle := FCreate( cFilename  )
     IF FError() # 0
        ? "Error with  " + AllTrim( cfilename ) 
        RETURN
     ENDIF
     FWrite( nHandle, "Hello"+chr(13)+chr(10))
     FClose( nHandle )
  RETURN NIL


2012/6/13 Przemysław Czerpak <dru...@poczta.onet.pl>



--
Massimo Belgrano

Delta Informatica S.r.l. (http://www.deltain.it/) (+39 0321 455962)
Analisi e sviluppo software per Lan e Web -  Consulenza informatica - Formazione

Massimo Belgrano

unread,
Jun 13, 2012, 3:21:12 PM6/13/12
to harbou...@googlegroups.com
here my collection about codepage, utf8 and unicode
https://docs.google.com/document/d/1ihscruxcNOcM20ri5AZZLqINxzsoSBopXG7-wE-BYJo/edit 


2012/6/13 Massimo Belgrano <mbel...@deltain.it>

Przemysław Czerpak

unread,
Jun 13, 2012, 3:58:09 PM6/13/12
to harbou...@googlegroups.com
On Wed, 13 Jun 2012, Massimo Belgrano wrote:

Hi Massimo,

> REQUEST HB_LANG_ES
> REQUEST HB_CODEPAGE_ES850C
> FUNC MAIN()
> Local cFilename :="PÓLIZA DIRECTORES Y ADMINISTRADORES.TXT"
> SET( _SET_CODEPAGE, "ES850>" )

Thank you very much but please fix typo in above line, it should be:
SET( _SET_CODEPAGE, "ES850C" )
otherwise it will not work.

best regards,
Przemek

Massimo Belgrano

unread,
Jun 13, 2012, 4:03:34 PM6/13/12
to harbou...@googlegroups.com
Thanks
is possible give a error when a codepage not exist
like  SET( _SET_CODEPAGE, "ES850>" ) 

2012/6/13 Przemysław Czerpak <dru...@poczta.onet.pl>



--
Massimo Belgrano

Przemysław Czerpak

unread,
Jun 13, 2012, 4:06:28 PM6/13/12
to harbou...@googlegroups.com
On Wed, 13 Jun 2012, Massimo Belgrano wrote:

Hi,

> Thanks
> is possible give a error when a codepage not exist
> like SET( _SET_CODEPAGE, "ES850>" )

I'll add such modification soon.

best regards,
Przemek

Nicanor Martinez Martinez

unread,
Jun 16, 2012, 12:33:00 AM6/16/12
to harbou...@googlegroups.com
In old versions is not necesary to scpecify codepage and special chracters works fine after update to new version all special characters used to create file changed.


Regards,

Nicanor


2012/6/13 Przemysław Czerpak <dru...@poczta.onet.pl>

Przemysław Czerpak

unread,
Jun 16, 2012, 6:42:56 AM6/16/12
to harbou...@googlegroups.com
On Fri, 15 Jun 2012, Nicanor Martinez Martinez wrote:

Hi,

> In old versions is not necesary to scpecify codepage and special chracters
> works fine after update to new version all special characters used to
> create file changed.

And I suggest you to stay with this old versions.
The new one are only for people clever enough to read ChangeLog ;-)

best regards,
Przemek

Massimo Belgrano

unread,
Jun 16, 2012, 8:46:06 AM6/16/12
to harbou...@googlegroups.com

new version give you many powerfull capabilities that you can read in changelog

Nicanor Martinez Martinez

unread,
Jun 18, 2012, 2:29:50 AM6/18/12
to harbou...@googlegroups.com
Ok,

after read change log solved using codepage ESWIN and work fine with last versions BCC, MVC, MINGW


REQUEST HB_LANG_ES
REQUEST HB_CODEPAGE_ESWIN

Function Main()


SET( _SET_CODEPAGE, "ESWIN" )
...
...

Regards,

Nicanor

2012/6/16 Massimo Belgrano <mbel...@deltain.it>
Reply all
Reply to author
Forward
0 new messages