I have linked Baan to external executable using run.prog() to decode a given amount of money from numbers format to Arabic words in order to print some Arabic reports. The executable output a text file with a single line of Arabic string. Then I open the file, read the content and close it using seq.open, seq.gets and seq.close. I was successfully able to get the results into the reports, however, seq.gets() returns unrecognized characters. I've tried mb.import$(), uni.import() with no luck to convert the string out of seq.gets() variable.
extern domain tcmcs.long ret1, ret2, ret3, ret4, ret5
extern domain tcmcs.str100 comm
extern domain tcmcs.str6 amnt
extern domain tcmcs.str80m arabic_decode1, arabic_decode2
amnt = str$(amount)
comm = "e:\arabicdecode\arabicdecode.exe " & amnt
ret1 = run.prog("cmd.exe", "cmd /c " & comm, RP_WAIT)
if ret1 = 0 then
ret2 = seq.open("e:\arabicdecode\converted.txt","r")
ret3 = seq.gets(arabic_decode1, 80 ,ret2, GETS_NORMAL, ret4)
ret5 = seq.close(ret2)
So, how to read this unicode text file with its Arabic characters?
Hint - Our environment installation has Arabic locale already, the database accept Arabic and we have some running Arabic reports.
Attached is a snapshot of the debugger with the garbage string.