Text Encoding questions in UI

Hi everyone,

I’m populating some popupmenus with JSON data I’m getting from a web service. This data has some URL Encoded characters like in the string: “S%C3%A3o Paulo”

However when I run DecodeURLComponent on these strings I end up with characters that do not display properly in the UI:

2023-08-07_16-23-46

This should show up as: São Paulo

To complicate matters further, I still need to retain the original encoding because it will need to be submitted back to the web service in the same format in order to be understood.

Any idea how to get these characters to display properly?

After decoding you’ll need to use the DefineEncoding method to set the string to UTF-8

2 Likes

Thank you Greg! That did it!

inputStr = DecodeURLComponent(inputStr).DefineEncoding(Encodings.UTF8)