1. Daniel Seguin
  2. PowerBuilder
  3. Tuesday, 13 August 2024 22:33 PM UTC

Hello,

I am tring to save a RTE document in html and ansi character set

No matter what encoding parameter I use, it returns utf8

I am using Powerbuilder 2022R3

Is there any issues with the encoding parameter?

Example:

string ls_file1, ls_file2, ls_file3, ls_file4, ls_file5

ls_file1 = "C:\local\work\test_default.htm"
ls_file2 = "C:\local\work\test_ansi.htm"
ls_file3 = "C:\local\work\test_utf8.htm"
ls_file4 = "C:\local\work\test_utf16le.htm"
ls_file5 = "C:\local\work\test_utf16be.htm"

// the 3rd parameter as no effect on the encoding used
// all french letters are shown in utf8
// I have a client wants to get ansi! to have characters in html / SO-8859, a collection of 8-bit character sets compatible with ASCII.

rte_1.savedocument(ls_file1,FileTypeHtml!) // file generated in utf8
rte_1.savedocument(ls_file2,FileTypeHtml!,EncodingAnsi!) // file generated in utf8
rte_1.savedocument(ls_file3,FileTypeHtml!,EncodingUTF8!) // file generated in utf8
rte_1.savedocument(ls_file4,FileTypeHtml!,EncodingUTF16LE!) // file generated in utf8
rte_1.savedocument(ls_file5,FileTypeHtml!,EncodingUTF16BE!) // file generated in utf8

Content of the each of the 5 files is the same regardless... 

I do see the é in my name but the client would like to see the é as the html value, since they have a cobol program expecting it like that.

 

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 14 August 2024 00:16 AM UTC
  2. PowerBuilder
  3. # 1

Hi Daniel;

  If you check the SaveDocument() method in the PB help, you will notice that the Encoding setting is only valid for the FileTypeText! argument.  HTH 

Regards ... Chris 

Comment
  1. Daniel Seguin
  2. Wednesday, 14 August 2024 02:05 AM UTC
Thanks Chris! I should have seen this, I was looking for something more complicated.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 14 August 2024 02:45 AM UTC
No problem... I probably just had more coffee than you. ;-)
  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.