cGetFile32 not support Chinese File Name

Post Reply
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

cGetFile32 not support Chinese File Name

Post by richard-service »

Hi
Yesterday, I tested it.

Code: Select all

LOCAL cFileName
LOCAL cString := "所有 Excel 檔案|*.XLS|" + ;
                 "Excel 檔案     |*.XLS|" + ;
                 "所有檔案       | *.*"

cFileName := cGetFile( cString, "請選擇要抓入之檔案名稱", , "" )
cFileName := cGetFile32( cString, "請選擇要抓入之檔案名稱", , "" )
 
cFileName Get string below:
D:\客戶資料2.xls
or
R:\Project\CustomerRelationshipManagementErp\SQL-Unicode-SDI\242\Fivetech\Exe32\客戶資料2.xls
Run this code not work below:

Code: Select all

If ! File( ( cFileName ) )  //==> Alwayse appear File not
 

Code: Select all

oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cFileName)
 
or

Code: Select all

oExcel := CreateObject( "Excel.Application" ) 
oExcel:WorkBooks:Open(cFileName)
 
Got Error message below:
Error description: Error Excel.Application:WORKBOOKS/14 DISP_E_BADPARAMCOUNT: OPEN
So, If I change Chinese File Name to English Name.
It's work fine.
Regards,

Richard

Harbour 3.2.0dev (r1904111533)/xHarbour 1.2.3 Intl. (SimpLex) (Build 20180818) => Borland C++ v7.4
xHarbour 0.99.71 (SimpLex) => Borland C++ v5.5
MySQL v5.7 /ADS v12
Harbour 3.2.0dev (r1603181642) => Borland C++ v7.4 64bit
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: cGetFile32 not support Chinese File Name

Post by nageswaragunupudi »

If you use Harbour instead of xHarbour it works fine with utf8 file names.
Regards

G. N. Rao.
Hyderabad, India
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: cGetFile32 not support Chinese File Name

Post by richard-service »

nageswaragunupudi wrote:If you use Harbour instead of xHarbour it works fine with utf8 file names.
Rao,
Yes, I thinking maybe it's finnal solution.
Regards,

Richard

Harbour 3.2.0dev (r1904111533)/xHarbour 1.2.3 Intl. (SimpLex) (Build 20180818) => Borland C++ v7.4
xHarbour 0.99.71 (SimpLex) => Borland C++ v5.5
MySQL v5.7 /ADS v12
Harbour 3.2.0dev (r1603181642) => Borland C++ v7.4 64bit
Post Reply