Ethereal-dev: Re: [ethereal-dev] How should dissectors define "printable"?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Juergen Schoenwaelder <schoenw@xxxxxxxxxxxxxxx>
Date: Wed, 5 Jul 2000 09:29:59 +0200
>>>>> Guy Harris writes:

[...]

Guy> There are some dissectors that should perhaps continue to use
Guy> "isprint()", as the data in question might well be a string in a
Guy> non-English language (although if the string is in a double-byte
Guy> character set, or in UTF-8, say, it might still not be displayed
Guy> correctly; alas, without knowing what character set it's in, we
Guy> can't necessarily display it correctly...).

I think the important statement above is that unless you know the
character set, you can't be sure that you do the right thing by
interpreting data in your current locale. Thus, I suggest to do an
"isascii() && isprint()" test unless you know the character set.

/js

-- 
Juergen Schoenwaelder      Technical University Braunschweig
<schoenw@xxxxxxxxxxxxxxx>  Dept. Operating Systems & Computer Networks
Phone: +49 531 391 3289    Bueltenweg 74/75, 38106 Braunschweig, Germany
Fax:   +49 531 391 5936    <URL:http://www.ibr.cs.tu-bs.de/~schoenw/>