Problem with encoding

I’m sticking some stuff into a listbox where there can be Danish hibit characters in user entered text and I’m having a small problem with encodings.

ISOLatin1 should be the right encoding, here’s what I’m doing prior to stuffing the text into a cell in a listbox:

strFieldName = ConvertEncoding(strFieldName,Encodings.ISOLatin1)

Still gives me a question mark as a placeholder for Danish hibit chars in cells in the listbox, better than the default that just used a black square.

The font for the listbox (System) has the Danish characters.

Anything else I need to get the font displayed correctly?

Where is the text coming from? If you’re reading it from a file or database, you need to use DefineEncoding, not ConvertEncoding. If the user entered it in a text field, you shouldn’t have to do anything.

It’s read from a textfile.

And bingo, DefineEncoding with “Encodings.SystemDefault” fixed that right up.

I’m guessing “Encodings.SystemDefault” is the better one to use as that would seem to follow whatever the user has setup.

I can’t really rely on any specific encoding, could be a Chinese guy living in Denmark with his OS installed in Chinese.

Thanks :slight_smile: