I am filling a PopupMenu from a MySQL database by going through the records and using Popupmenu.AddRow for each returned record.
This works well, but some characters have problems. In particular, the degrees symbol, °, gets turned into some kind of odd character. Elsewhere in the app, I can tack “.DefineEncoding(Encodings.ISOLatin1)” onto the end of the field value and it shows up correctly in a list or text box. But even if I do this:
LocationSelect.AddRow(resultsL.Field("display").StringValue.DefineEncoding(Encodings.ISOLatin1))
It still shows up mangled.
I can type a degree symbol into the InitialValue, and it shows up correctly.
But there is something peculiar going on here. Any thoughts?
Are you setting the encoding to ISOLatin1 because that’s how the database is encoded? If not, you should use the same encoding as the database. Not doing so can cause issues like this.
Also, you should define the encoding for all strings from an external source, be it a database, text file or anything else.