mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
This commit is contained in:
commit
5521ab2910
@ -1744,14 +1744,18 @@ field_op(struct session *ses, struct document_view *doc_view,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
{
|
if (ses->tab->term->utf8) {
|
||||||
/* The charset of the terminal; we assume
|
/* fs->value is in UTF-8 regardless of
|
||||||
* fs->value is in this charset.
|
* the charset of the terminal. */
|
||||||
* (Is that OK?) */
|
text = encode_utf8(get_kbd_key(ev));
|
||||||
|
} else {
|
||||||
|
/* fs->value is in the charset of the
|
||||||
|
* terminal. */
|
||||||
int cp = get_opt_codepage_tree(ses->tab->term->spec,
|
int cp = get_opt_codepage_tree(ses->tab->term->spec,
|
||||||
"charset");
|
"charset");
|
||||||
|
|
||||||
text = u2cp_no_nbsp(get_kbd_key(ev), cp);
|
text = u2cp_no_nbsp(get_kbd_key(ev), cp);
|
||||||
|
}
|
||||||
length = strlen(text);
|
length = strlen(text);
|
||||||
|
|
||||||
if (strlen(fs->value) + length > fc->maxlength
|
if (strlen(fs->value) + length > fc->maxlength
|
||||||
@ -1763,7 +1767,6 @@ field_op(struct session *ses, struct document_view *doc_view,
|
|||||||
fs->state += length;
|
fs->state += length;
|
||||||
if (fc->type == FC_TEXTAREA)
|
if (fc->type == FC_TEXTAREA)
|
||||||
fs->state_cell = 0;
|
fs->state_cell = 0;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
fs->value[fs->state++] = get_kbd_key(ev);
|
fs->value[fs->state++] = get_kbd_key(ev);
|
||||||
#endif /* CONFIG_UTF8 */
|
#endif /* CONFIG_UTF8 */
|
||||||
|
@ -115,7 +115,9 @@ get_link_cursor_offset(struct document_view *doc_view, struct link *link)
|
|||||||
struct form_control *fc;
|
struct form_control *fc;
|
||||||
struct form_state *fs;
|
struct form_state *fs;
|
||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
int utf8 = doc_view->document->options.utf8;
|
/* The encoding of form fields depends on the terminal,
|
||||||
|
* rather than on the document. */
|
||||||
|
int utf8 = doc_view->session->tab->term->utf8;
|
||||||
#endif /* CONFIG_UTF8 */
|
#endif /* CONFIG_UTF8 */
|
||||||
|
|
||||||
switch (link->type) {
|
switch (link->type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user