FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Question about function file
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Question about function file
Posted: Wed Feb 14, 2024 10:01 PM
Hello everyone.
I am observing a difference in the behavior of the File() function when migrating from xHarbour 123 to Harbour 320:
Code (fw): Select all Collapse
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.
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Question about function file
Posted: Thu Feb 15, 2024 09:26 AM
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. :-(
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Question about function file
Posted: Thu Feb 15, 2024 12:16 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: Question about function file
Posted: Mon Feb 19, 2024 09:10 PM
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.
karinha wrote:https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43844&p=264863&hilit=longname&sid=714d291ed0a2c9290d53183020f6ae6c&sid=714d291ed0a2c9290d53183020f6ae6c#p264863

Regards, saludos.
This is not about long names, Kapiaba.
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#

Continue the discussion