views:

40

answers:

1

Hi, I have a function that finds any ISO 8859-1 symbol within a given string, and tries converting it to its proper meaning. However, I get question marks instead where I'd like actual values like : ÿ é æ etc.

Can you please point me in the right direction on how to properly handle foreign/unique symbols?

+2  A: 

From the wording of your question, it sounds like you are attempting to identify byte values in a string and then convert them - this won't work. Strings are composed of characters and each character can consist of more than one byte (depending on the encoding). In other words, the conversion from a stream of bytes to a human-readable string is already performed by the time you access a string.

Have a look at the System.Text.Encoding class. If you really do want to convert a byte stream from one encoding to another, try System.Text.Encoding.Convert().

But it would be nice to know more details about your specific task so that people can give you a more precise answer.

Canoehead