Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Bug 210995] cat -v fails to tag characters in extended table with M- prefix with some locales

1 view
Skip to first unread message

bugzilla...@freebsd.org

unread,
Aug 4, 2016, 1:10:16 PM8/4/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

John Baldwin <j...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |ac...@FreeBSD.org,
| |ba...@FreeBSD.org

--- Comment #1 from John Baldwin <j...@FreeBSD.org> ---
Taking a guess at adding some folks I think might be more knowledgable about
locales to cc.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebs...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs...@freebsd.org"

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 2:38:54 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

--- Comment #2 from Andrey Chernov <ac...@FreeBSD.org> ---
Removing isprint() is good, but why you need LC_ALL?

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 2:54:32 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

--- Comment #3 from Andrey Chernov <ac...@FreeBSD.org> ---
From second thought, this patch does not help at all.
Looking at the code I realize that cat should use wide chars everywhere,
getwc(), isw*() etc (with fallback to getc() on error). Current code suppose
single byte locale and will works incorrectly for any multibyte locale.

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 10:05:14 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

--- Comment #4 from Andrey Chernov <ac...@FreeBSD.org> ---
Created attachment 173315
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173315&action=edit
use wide chars with fallback to plain ones

More testing required, I test a little.

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 10:12:08 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

Andrey Chernov <ac...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #173315|0 |1
is obsolete| |

--- Comment #5 from Andrey Chernov <ac...@FreeBSD.org> ---
Created attachment 173316
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173316&action=edit
use wide chars with fallback to plain ones

Move err label higher to not miss clearerr(fp)

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 10:41:33 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

Andrey Chernov <ac...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #173316|0 |1
is obsolete| |

--- Comment #6 from Andrey Chernov <ac...@FreeBSD.org> ---
Created attachment 173318
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173318&action=edit
use wide chars with fallback to plain ones

Use traditional M-^X form for non-ascii controls

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 10:49:47 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

--- Comment #7 from Andrey Chernov <ac...@FreeBSD.org> ---
BTW, this is wrong:
foreach i ( `jot 178 178 356` )
echo a | tr 'a' "\$i" | cat -v

tr suppose to take \octal numbers only, but they are decimal.

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 11:02:37 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210995

--- Comment #8 from Andrey Chernov <ac...@FreeBSD.org> ---
It must be
foreach i ( `( echo obase=8 ; jot 178 178 255 1) | bc` )
0 new messages