I
Ian Chard
Hi,
I need to be able to tell if a character in the ISO-8859-15 codeset
(i.e. 8-bit ASCII, incorporating things like accented 'a' or euro currency
symbol) is printable. Ordinarily I'd use isprint(), but obviously this is
only going to work for 7-bit "true ASCII" characters.
I've thought of running the program in a different locale, but I want to
catch *all* printable characters, not only those used by a specific
locale. It'd be nice for the code to be as portable as possible, too.
I could just write a macro to range-check the character (it's not like the
standard's going to change), but I'd prefer a cleaner way if possible!
All help gratefully appreciated.
Cheers
- Ian
I need to be able to tell if a character in the ISO-8859-15 codeset
(i.e. 8-bit ASCII, incorporating things like accented 'a' or euro currency
symbol) is printable. Ordinarily I'd use isprint(), but obviously this is
only going to work for 7-bit "true ASCII" characters.
I've thought of running the program in a different locale, but I want to
catch *all* printable characters, not only those used by a specific
locale. It'd be nice for the code to be as portable as possible, too.
I could just write a macro to range-check the character (it's not like the
standard's going to change), but I'd prefer a cleaner way if possible!
All help gratefully appreciated.
Cheers
- Ian