SAP Knowledge Base Article - Preview

2415775 - CR 803112: FileOpen() fails with EncodingUTF16BE! or EncodingUTF16LE - SAP PB 12.6

Symptom

  • When FileOpen() is used to create an output file with the EncodingUTF16BE! or EncodingUTF16LE!, PowerBuilder will create the file with incorrect encoding.
  • When reopening the file with FileOpen(), the function returns -1. 

Example:
for i = 1 to 2
li_filenum = 0
li_filenum = fileopen('UTF16BE.txt', StreamMode!, write!, lockreadwrite!, append!, EncodingUTF16BE!)
if li_filenum < 0 then     <-- returns -1 on second for..next loop.
    messagebox('fileopen failed', string(li_filenum))
    exit
end if
i_ret = fileclose(li_filenum)
next


Read more...

Environment

  • SAP PowerBuilder 12.6 (build 4108)

Product

SAP PowerBuilder 12.6

Keywords

fileopen,encoding,pb,powerbuilder,encodingutf16be,encodingutf16be!,encodingutf16le,encodingutf16le!,fails , KBA , BC-SYB-PB , PowerBuilder , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.