Check if string observes specific encoding/codepage

  • Thread starter Thread starter John Hansen
  • Start date Start date
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
 
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.
 
Back
Top