Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 22nd January 2013, 13:33
aseela aseela is offline
Newbie
 
Join Date: Sep 2012
Posts: 2
aseela is on a distinguished road
Baan: 6.1 fp3 - DB: windows sql server - OS: windows server 2008 R2
Reading Arabic characters from a text file
Baan: ERP LN 6.1 FP3
C/S: Server

Dear Expert,

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.

Code:
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)
endif
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.

Thank you
Attached Images
File Type: png ArabicDecode.png (5.9 KB, 27 views)
Reply With Quote
  #2  
Old 22nd January 2013, 14:36
aseela aseela is offline
Newbie
 
Join Date: Sep 2012
Posts: 2
aseela is on a distinguished road
Baan: 6.1 fp3 - DB: windows sql server - OS: windows server 2008 R2
Smile Reading Arabic from a text file

Thank you guys for the rich content of this forum. It helps me solve a lot of issues I'm facing. Regarding this issue, it is solved using utf8.import(). like this:
Code:
ret2 = seq.open("e:\arabicdecode\converted.txt","r")
ret3 = seq.gets(arabic_decode1, 80 ,ret2, GETS_NORMAL, ret4)
ret3 = utf8.import(arabic_decode2, arabic_decode1)
ret5 = seq.close(ret2)
Thank you
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Question mr_suleyman Tools Development 37 11th November 2016 09:14
Undocumented Functions & Variables george7a Tools Development 81 30th September 2015 12:35
Audit file structure baan_user Tools Development 8 4th May 2007 15:32
seq.open berthe Miscellaneous 4 12th May 2005 11:20


All times are GMT +2. The time now is 03:53.


©2001-2017 - Baanboard.com - Baanforums.com