Re: how to get rid of a character, 0x80?
- From: Gary Kline <kline@xxxxxxxxxxx>
- Date: Tue, 8 Sep 2009 12:21:38 -0700
On Tue, Sep 08, 2009 at 08:02:06AM -0500, Jim White wrote:
On Tue, Sep 8, 2009 at 7:43 AM, Jon Radel <jon@xxxxxxxxx> wrote:
Mark Stapper wrote:
it's 0200 octal which is 128 decimal...
Might be why it doesn't work for you.
Don't mess with his head. ;-)
0200 = 0x80 = 128
200 octal = 80 hex = 128 decimal
You may want to check if your char type is signed. If it is (and it just
happens to be 8 bits wide), (char)128 is a negative value.
int ch, not char ch;
Also, just found some throwaway code that [of course] never gets pitched, and
found the for chars >= 128, it's a wide character.
while (( ch = getwc(stdin)) != WEOF)
if (ch == L'\xe2')
if ((ch1 = getwc(stdin)) == L'\x80')
/* check for and swallow last of the trio */
if ((ch2 = getwc(stdin)) == L'\x90')
I wrote the above to get rid of openoffice TXT that was still cluttered with the
trio of wide characters that output one apostrophe.
Last night I used pdftotext to translate a pdf file; it was cluttered with a slew of
^L's, which == '\014', and wound up with a greater slew of <x80> in more [less]
and vi. Nutshell, the file was fubar'd.
Gary Kline kline@xxxxxxxxxxx http://www.thought.org Public Service Unix
The 5.67a release of Jottings: http://jottings.thought.org/index.php
freebsd-questions@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"