- Simone Olianti
- PowerBuilder
- Thursday, 15 November 2018 12:08 PM UTC
Hello i have a source text file with ansi encoding written using Macintosh (CR) containing a sequence of EOT,EOT NUL characters every 1024 bytes.
I need to read this file and convert it to a string. I tried to open it in stream mode, and used the filereadex to put the content in a blob variable. Anyway when i try to convert the blob to a string i get it truncated before the first NUL character.
li_FileNum = FileOpen(ls_nomefile, streamMode!, Read!, LockWrite!, Replace!)
eRet = FileEncoding(ls_nomefile)
li_bytes = FileReadEx(li_filenum, bdata)
ls_string = string(bdata, eRet)
Is there a simple way to remove the NUL characters and get the whole file in a string variable?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.