On Fri, 8 Aug 2014 11:47:46 -0400, Robert A. Rosenberg wrote: > >><x-charset UTF-8>On Fri, 8 Aug 2014 04:29:20 -0400, Robert A. Rosenberg wrote: >>> >>>1) Use a TRT of the EBCDIC input string to verify that all the >>>characters have valid ASCII codes. The table would have x'00' if the >>>code can be mapped to ASCII and x'ff' if not. Hitting any of the >>>x'ff' entries means problems. >>> >>I recommend omitting step (1) because it has no effect on the output. > >I include it as a sanity check since you need to know if you are >attempting to submit a codepoint that will not map to ASCII. If the >TRT puts a x'ff' into R2 you have a string that can not be converted >to ASCII. > ASCII can not be discerned from EBCDIC with a mere TRT, nor untimately at all. You have:
o False negatives: an EBCDIC string containing only code points that are aso valid ASCII, such as x'40' will be incorrectly recognized as ASCII. o False positives: a UTF-8 string, ISO8859-1, or binary data will be incorrectly recgnized as EBCDIC. And base64 is routinely used to encode all of those. Untimately, there may be nothing better than visual inspection. Unless you know the provenance and intent of your input data. Beyond that, what code pages should your TR presume for your input data? -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
