- Phil Jorgensen
- PowerBuilder
- Wednesday, 31 January 2024 10:33 PM UTC
Hello,
I have a question on string encoding behavior when sending an HTML SMTP message. Here is a description of the workflow:
First, we are reading in an HTML file as a message template. We are also reading a customizable message from a DataWindow from a value stored in the database. We do a Replace to insert the custom message into the template before passing the entire string to the SMTP service.
The issue I'm having is that the resulting email seems to have two different encodings. Both the template HTML file and the custom message inserted into it contain accented characters, but in the received message the custom characters are not displayed correctly, while the template characters are.
Using Notepad++ to switch between UTF-8 and ANSI encodings seems to switch which characters are displayed correctly, which is odd.
Since it is my understanding that PowerBuilder 2021 uses Unicode internally for all processing, how could this be possible? Is there a way to re-encode the string as Unicode to ensure consistency?
Thank you,
Phil
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.