There is no way to do this in JavaScript. Fortunately, neither Windows-1252 nor ISO-8859-1 is variable-width encoding, so you can write something, say, in .NET or something that understands character encodings, to make a regular expression to test this .
For example, in .NET you can create an array of bytes with 256 bytes, one for each character, and then use each encoding to get the corresponding string. Find out the differences in these lines, encode them in a regular expression, and there you go.
source share