mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
Add utf-8 support to cols.c
This commit is contained in:
@@ -19,6 +19,14 @@ char **argv;
|
||||
|
||||
|
||||
for ( xp = 1; (c = getchar()) != EOF; xp++ ) {
|
||||
if ( c & 0x80 ) {
|
||||
/* assume that (1) the output device understands utf-8, and
|
||||
* (2) the only c & 0x80 input is utf-8.
|
||||
++xp;
|
||||
do {
|
||||
putchar(c);
|
||||
} while ( (c = getchar()) != EOF && (c & 0x80) );
|
||||
}
|
||||
if ( c == '\n' )
|
||||
xp = 0;
|
||||
if ( xp <= width )
|
||||
|
||||
Reference in New Issue
Block a user