many bug about local file/directory when name is utf8

many bug about local file/directory when name is utf8

Postby ssbbs » Thu May 27, 2021 2: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
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Thu May 27, 2021 3:47 pm

I will test point by point and answer one by one.

b. GetModulefileName/cFilePath....


ExeName:
Code: Select all  Expand view
#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
 


Image

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby ssbbs » Thu May 27, 2021 3:58 pm

cFilePath()、GetModulefileName() ?
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Thu May 27, 2021 4: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Thu May 27, 2021 4: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Thu May 27, 2021 4:12 pm

2. directory is utf8 name, ex: 'c:\temp\中文龍咙\'


Test:
Code: Select all  Expand view
#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
 

Image
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Thu May 27, 2021 4:13 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Thu May 27, 2021 4:53 pm

FilePath:
Code: Select all  Expand view
  ? "cFile =", cFile, "cFilePath =", cFilePath( cFile ), "cFileNoPath=", cFileNoPath( cFile )
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby ssbbs » Fri May 28, 2021 1: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
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Fri May 28, 2021 3:27 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: many bug about local file/directory when name is utf8

Postby ssbbs » Fri May 28, 2021 4: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
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: many bug about local file/directory when name is utf8

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

Re: many bug about local file/directory when name is utf8

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

Re: many bug about local file/directory when name is utf8

Postby ssbbs » Sat May 29, 2021 2: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
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: many bug about local file/directory when name is utf8

Postby nageswaragunupudi » Sat May 29, 2021 1: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: Select all  Expand view
[నామము]
పేరు=రమణ
ఇంటిపేరు=చెరువు
[ద్వితీయము]
వయసు=40
జీతము=20000
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 59 guests