mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
dump: Replace control characters with spaces
In DUMP_FUNCTION_SPECIALIZED, use isscreensafe_ucs (for UTF-8) or isscreensafe (for unibyte) to detect control characters, and replace them with spaces. add_document_to_string already did the same.
This commit is contained in:
parent
ee182ced2b
commit
2f0cefffb5
@ -128,7 +128,13 @@ DUMP_FUNCTION_SPECIALIZED(struct document *document, int fd,
|
|||||||
&& c >= 176 && c < 224)
|
&& c >= 176 && c < 224)
|
||||||
c = frame_dumb[c - 176];
|
c = frame_dumb[c - 176];
|
||||||
|
|
||||||
if (c <= ' ') {
|
if (c == ' '
|
||||||
|
#ifdef DUMP_CHARSET_UTF8
|
||||||
|
|| !isscreensafe_ucs(c)
|
||||||
|
#else
|
||||||
|
|| !isscreensafe(c)
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
/* Count spaces. */
|
/* Count spaces. */
|
||||||
white++;
|
white++;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user