1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05: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:
Kalle Olavi Niemitalo 2009-06-19 14:10:50 +03:00 committed by Kalle Olavi Niemitalo
parent ee182ced2b
commit 2f0cefffb5

View File

@ -128,7 +128,13 @@ DUMP_FUNCTION_SPECIALIZED(struct document *document, int fd,
&& c >= 176 && c < 224)
c = frame_dumb[c - 176];
if (c <= ' ') {
if (c == ' '
#ifdef DUMP_CHARSET_UTF8
|| !isscreensafe_ucs(c)
#else
|| !isscreensafe(c)
#endif
) {
/* Count spaces. */
white++;
continue;