mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Fixed the issue when assummed codepage is not UTF-8
This commit is contained in:
parent
8c3f931ff0
commit
70a46e12aa
@ -168,6 +168,7 @@ AC_HEADER_STDC
|
|||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(wctype.h)
|
||||||
AC_CHECK_HEADERS(fcntl.h limits.h time.h unistd.h)
|
AC_CHECK_HEADERS(fcntl.h limits.h time.h unistd.h)
|
||||||
AC_CHECK_HEADERS(sigaction.h)
|
AC_CHECK_HEADERS(sigaction.h)
|
||||||
AC_CHECK_HEADERS(arpa/inet.h)
|
AC_CHECK_HEADERS(arpa/inet.h)
|
||||||
|
@ -518,7 +518,9 @@ add_document_lines(struct plain_renderer *renderer)
|
|||||||
int length = renderer->length;
|
int length = renderer->length;
|
||||||
int was_empty_line = 0;
|
int was_empty_line = 0;
|
||||||
int was_wrapped = 0;
|
int was_wrapped = 0;
|
||||||
|
#ifdef CONFIG_UTF_8
|
||||||
|
int utf8 = is_cp_utf8(renderer->document->cp);
|
||||||
|
#endif
|
||||||
for (; length > 0; renderer->lineno++) {
|
for (; length > 0; renderer->lineno++) {
|
||||||
unsigned char *xsource;
|
unsigned char *xsource;
|
||||||
int width, added, only_spaces = 1, spaces = 0, was_spaces = 0;
|
int width, added, only_spaces = 1, spaces = 0, was_spaces = 0;
|
||||||
@ -549,7 +551,7 @@ add_document_lines(struct plain_renderer *renderer)
|
|||||||
was_spaces = 0;
|
was_spaces = 0;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_UTF_8
|
#ifdef CONFIG_UTF_8
|
||||||
if (renderer->document->options.utf8) {
|
if (utf8) {
|
||||||
unsigned char *text = &source[width];
|
unsigned char *text = &source[width];
|
||||||
unicode_val_T data = utf_8_to_unicode(&text,
|
unicode_val_T data = utf_8_to_unicode(&text,
|
||||||
&source[length]);
|
&source[length]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user