Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 29 MAR 1999 11:24:40AM Oystein Reigem wrote:

Just a note to all you guys out there working on apps with international characters. Or am I just talking to myself?:

DirList() and its ilk do not handle ANSI 8-bit characters. So if one has folder and/or file names with 8-bit characters one has to do the necessary conversions oneself.

First (if 8-bit folder names) one must make sure InitDir is fed a path name in MSDOS text:

declare subroutine AnsiToOem

MSDOSPath=Path

AnsiToOem( MSDOSPath, MSDOSPath )

InitDir MSDOSXPath:"\*.*"

If this is the first time one uses the AnsiToOem subroutine one must also declare it. The opposite function - OemToAnsi - is already declared in OI. To declare AnsiToOem open row DLL_KEYBOARD in SYSPROCS:

KEYBOARD

VOID PASCAL OemToAnsi(LPCHAR, LPCHAR)

Add the line

VOID PASCAL AnsiToOem(LPCHAR, LPCHAR)

Then from the Exec line do

run DECLARE_FCNS 'DLL_KEYBOARD'

Second (if 8-bit file names) one must convert the file names returned by DirList from MS-DOS text to ANSI with OemToAnsi. So if FileNames is a @FM-delimited array from DirList, one must

declare subroutine OemToAnsi

NumFileNames=count( FileNames, @FM ) + (FileNames "")

for F=1 to NumFileNames

Temp=FileNames

OemToAnsi( Temp, Temp )

FileNames=Temp

next F

(Don't try to OemToAnsi-convert the whole array. That will make your @FMs into underscores. And don't try to let OemToAnsi return directly into an array element.) (Btw - remember to consult the DirList() docs for how to get back more than 4000 chars of file name data.)

- Oystein -

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/083a54cd6c9579ce852567430054a813.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1