06-15-2006 6:30 PM
I need to check a field to make sure it only contains (printable) characters from the good old 7-bit ANSI codepage. This is to make sure that when ALEing the data to non-Unicode systems, which in our environment can have just about any codepage (except Asian ones), all characters are displayable.
In a non-Unicode system, I could cast each character into a hex field and check that its value is smaller than or equal to 7F; in a Unicode system, this doesn't seem to be a suitable approach.
I could of course define a string into which I enter all the allowed characters and then compare with a CO statement; but I'm hoping that somebody has a more elegant solution.
06-15-2006 8:57 PM
Since you've mentioned no asian characters, Assuming the unicode character uses 2bytes, then in big-endian system, check the value is smaller or equal to 007F, in little endian system check the value is smaller or equal to 7F00.
Regards
Sridhar
06-15-2006 8:57 PM
Since you've mentioned no asian characters, Assuming the unicode character uses 2bytes, then in big-endian system, check the value is smaller or equal to 007F, in little endian system check the value is smaller or equal to 7F00.
Regards
Sridhar