From bbd24d7bf40bfaa788641803994f53abef79f5d4 Mon Sep 17 00:00:00 2001 From: Pavol Babincak Date: Sat, 6 May 2006 21:23:12 +0200 Subject: [PATCH] Corrected computing cell count for html select in UTF-8. --- src/document/html/parser/forms.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/document/html/parser/forms.c b/src/document/html/parser/forms.c index dc2ddbfa..eb253c2a 100644 --- a/src/document/html/parser/forms.c +++ b/src/document/html/parser/forms.c @@ -492,7 +492,13 @@ end_parse: max_width = 0; for (i = 0; i < order; i++) { if (!labels[i]) continue; - int_lower_bound(&max_width, strlen(labels[i])); +#ifdef CONFIG_UTF_8 + if (html_context->options->utf8) + int_lower_bound(&max_width, + utf8_ptr2cells(labels[i], NULL)); + else +#endif /* CONFIG_UTF_8 */ + int_lower_bound(&max_width, strlen(labels[i])); } for (i = 0; i < max_width; i++)