Check if string observes specific encoding/codepage

J

John Hansen

I have got an input string from a webservice, and I want to make sure, that
all characters in that string are defined in a specific encoding/codepage
(Windows-1252 in my case).
Is there an easy way to verify that all chars in a string are "allowed"
chars with regards to a certain codepage?

Thanks,
John
 
P

Pavel Minaev

I have got an input string from a webservice, and I want to make sure, that
all characters in that string are defined in a specific encoding/codepage
(Windows-1252 in my case).
Is there an easy way to verify that all chars in a string are "allowed"
chars with regards to a certain codepage?

Have a look at System.Text.Encoding.EncoderFallback.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top