FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour many bug about local file/directory when name is utf8
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 02:52 AM
  1. filename change from english to uft8, ex: 'abc.exe to ' 中文龍咙.exe'
  2. directory is utf8 name, ex: 'c:\temp\中文龍咙\'

a. read/write .ini, GetPvProfString/WritePProfString....
b. GetModulefileName/cFilePath....

line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 03:47 PM
I will test point by point and answer one by one.

b. GetModulefileName/cFilePath....


ExeName:
Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST HB_CODEPAGE_UTF8

function Main()

   HB_CDPSELECT( "UTF8" )
   FW_SetUnicode( .t. )

? "ExeName()", ExeName(), "HB_Argv(0)", HB_ArgV(0)

return nil




GetModuleFileName() is not Unicode compatible. Please do not use it. Instead, use ExeName() or HB_ARGV(0).
Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 03:58 PM

cFilePath()、GetModulefileName() ?

line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 04:06 PM

GetModuleFileName() is not Unicode compatible. Please do not use it. Instead, use ExeName() or HB_ARGV(0).

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 04:07 PM
a. read/write .ini, GetPvProfString/WritePProfString....


At present, these functions are not Unicode compatible.
We will provide Unicode compatible versions at the earliest.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 04:12 PM
2. directory is utf8 name, ex: 'c:\temp\中文龍咙\'


Test:
Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST HB_CODEPAGE_UTF8

function Main()

   HB_CDPSELECT( "UTF8" )
   FW_SetUnicode( .t. )

   XBROWSER DIRECTORY( "C:\FWH\TESTS\*.*", "D" ) ;
      TITLE 'DIRECTORY( "C:\FWH\TESTS\*.*", "D" )'

   XBROWSER DIRECTORYRECURSE( "C:\FWH\TESTS\*.*", "D" )

return nil


Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 04:13 PM

We will check other points raised by you and come back in a little time.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Thu May 27, 2021 04:53 PM
FilePath:
Code (fw): Select all Collapse
   ? "cFile =", cFile, "cFilePath =", cFilePath( cFile ), "cFileNoPath=", cFileNoPath( cFile )


Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: many bug about local file/directory when name is utf8
Posted: Fri May 28, 2021 01:09 AM
nageswaragunupudi wrote:
a. read/write .ini, GetPvProfString/WritePProfString....


At present, these functions are not Unicode compatible.
We will provide Unicode compatible versions at the earliest.


Thank you!! wait for your solution!
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Fri May 28, 2021 03:27 AM

Tested FILE() and FRENAME() functions and they are Unicode compatible.

Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: many bug about local file/directory when name is utf8
Posted: Fri May 28, 2021 04:25 AM
nageswaragunupudi wrote:Tested FILE() and FRENAME() functions and they are Unicode compatible.

harbour native function is ok.
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Fri May 28, 2021 12:36 PM
ssbbs wrote:
nageswaragunupudi wrote:Tested FILE() and FRENAME() functions and they are Unicode compatible.

harbour native function is ok.


Then what exactly is your difficulty in these areas?
1. filename change from english to uft8, ex: 'abc.exe to ' 中文龍咙.exe'
2. directory is utf8 name, ex: 'c:\temp\中文龍咙\'
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Fri May 28, 2021 12:37 PM

GetModuleFileName() and ShellExecute() are made Unicode compatible in the upcoming version of FWH to be released at any time.

Regards



G. N. Rao.

Hyderabad, India
Posts: 129
Joined: Mon Oct 17, 2005 03:03 AM
Re: many bug about local file/directory when name is utf8
Posted: Sat May 29, 2021 02:43 AM
nageswaragunupudi wrote:
ssbbs wrote:
nageswaragunupudi wrote:Tested FILE() and FRENAME() functions and they are Unicode compatible.

harbour native function is ok.


Then what exactly is your difficulty in these areas?
1. filename change from english to uft8, ex: 'abc.exe to ' 中文龍咙.exe'
2. directory is utf8 name, ex: 'c:\temp\中文龍咙\'


If directory name is ansi and APP name is utf8, file of read/write is ok, only access information of APP have some problem.
If directory name is utf8, all file of read/write have some problem.
line ID: ssbbstw

WeChat ID: ssbbstw
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: many bug about local file/directory when name is utf8
Posted: Sat May 29, 2021 01:43 PM
Tested TINI class in ini.prg.

Ini file name should be in English, but all contents can be in Unicode

This is the Unicode INI file crated and tested by me:
Code (fw): Select all Collapse
[నామము]
పేరు=రమణ
ఇంటిపేరు=చెరువు
[ద్వితీయము]
వయసు=40
జీతము=20000
Regards



G. N. Rao.

Hyderabad, India