1. Jorge Escobar
  2. PowerBuilder
  3. Saturday, 3 November 2018 22:53 PM UTC

Hi all

From PB 2017 R3 .JSON files are generated and deposited in a directory to be read by another third party application made in Java.
The JSON files generated from PowerBuilder are stored encoded in USC-2 LE BOM and the Java application requires that it be encoded in UTF8 or EncodingAnsi.

lnv_JsonGenerator.saveToFile (path and file name) is used to save the file. How would you do to save the file encoded in UTF8 or EncondingAnsi?

Note: you do not have access to the code of the Java application, so the change must be made in the PB application.

 

Regards,

 

Jorge

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 3 November 2018 23:27 PM UTC
  2. PowerBuilder
  3. # 1

Hi Jorge;

  How about using the GetJSONString or GetJSONBlob commands into a variable? Then convert it to UTF8 (or whatever format you need) and write the file yourself using the FileWriteEx command.

Regards ... Chris

Comment
  1. Jorge Escobar
  2. Saturday, 3 November 2018 23:57 PM UTC
Thank you very much, it worked!



It would be interesting if future versions in saveToFile of JsonPackage allow to specify the encoding.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 4 November 2018 00:49 AM UTC
Great news Jorge! ?

Yes, I agree. Please open a Support Ticket for this as an enhancement request. ?
  1. Helpful
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.