Page 1 of 1

Question about function file

PostPosted: Wed Feb 14, 2024 10:01 pm
by Eroni
Hello everyone.
I am observing a difference in the behavior of the File() function when migrating from xHarbour 123 to Harbour 320:

Code: Select all  Expand view

REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850

HB_SETCODEPAGE('PT850')
HB_LANGSELECT('PT')


xHarbour 123:
-----------------      
cFile := "D:\Tmp\_Arquivos_Enviar\RELATÓRIO DE ATIVIDADES xxxx 01-01-2024 a 31-01-2024.pdf" // Name of file contains accent

? File( cFile ) // Results .T.
? File( AnsiToOem(cFile)) // Results .F.
? File(OemToAnsi(cFile))  // Results .F.
     
cFile := "D:\Tmp\_Arquivos_Enviar\RELATORIO DE ATIVIDADES xxxx 01-01-2024 a 31-01-2024 - Copia.pdf" // Name of file not contains accent
? File( cFile ) // Results .T.
? File( AnsiToOem(cFile)) // Results .T.
? File(OemToAnsi(cFile))  // Results .T.

Harbour 320:  
----------------
cFile := "D:\Tmp\_Arquivos_Enviar\RELATÓRIO DE ATIVIDADES xxxx 01-01-2024 a 31-01-2024.pdf" // Name of file contains accent

? File( cFile ) // Results .F.                 // Diference here
? File( AnsiToOem(cFile)) // Results .T.
? File(OemToAnsi(cFile))  // Results .F. // Diference here
     
cFile := "D:\Tmp\_Arquivos_Enviar\RELATORIO DE ATIVIDADES xxxx 01-01-2024 a 31-01-2024 - Copia.pdf" // Name of file not contains accent
? File( cFile ) // Results .T.
? File( AnsiToOem(cFile)) // Results .T.
? File(OemToAnsi(cFile))  // Results .T.
 


Some idea?
Regards.

Re: Question about function file

PostPosted: Thu Feb 15, 2024 9:26 am
by Enrico Maria Giordano
I confirm this difference:

xHarbour:
? File( cFile ) // Results .T. This is the right one

Harbour:
? File( cFile ) // Results .F.

I have no clue about the cause, sorry. :-(

Re: Question about function file

PostPosted: Thu Feb 15, 2024 12:16 pm
by karinha

Re: Question about function file

PostPosted: Mon Feb 19, 2024 9:10 pm
by Eroni
Enrico Maria Giordano wrote:I confirm this difference:

xHarbour:
? File( cFile ) // Results .T. This is the right one

Harbour:
? File( cFile ) // Results .F.

I have no clue about the cause, sorry. :-(

Thank you Enrico.


This is not about long names, Kapiaba.