1. Subramanyam Kalivarapu
  2. PowerBuilder
  3. Monday, 5 August 2019 18:52 PM UTC

Hello All

I have used the below syntax which is not converting the encoding standard to UTF8! from ANSI!.

fileopen(as_filename,LineMode!, Write!,LockReadWrite!,Replace!,EncodingUTF8!)

The above statement is returning -1 if i'm passing EncodingUTF8! and returning 1 if the last argument in above statement is defined as EncodingANSI!.

My requirement is to convert file from ANSI! to UTF8!.

 

Please suggest.

 

Thanks

Subramanyam K.

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 6 August 2019 00:48 AM UTC
  2. PowerBuilder
  3. # 1

I think the issue is that you are expecting the file encoding argument to direct how some kind of data conversion is to be performed. That is not the purpose of this argument. This argument tells PB that the file you want to open for READING uses the specified file encoding.

Here is a key sentence from the FileOpen help topic:

If you specify the optional encoding argument and the existing file does not have the same encoding, FileOpen returns -1.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.