From 003f3537c6f6d45f9f04f04df98d502bfe45f550 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 30 Apr 2011 11:21:14 +0000 Subject: Ensure selection drags to NetSurf text boxes are always UTF-8 svn path=/trunk/netsurf/; revision=12263 --- amiga/clipboard.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'amiga') diff --git a/amiga/clipboard.c b/amiga/clipboard.c index a8122f1bd..ee9e692f5 100755 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2010 Chris Young + * Copyright 2008-2011 Chris Young * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -42,6 +42,7 @@ #include struct IFFHandle *iffh = NULL; +bool ami_utf8_clipboard = false; // force UTF-8 in clipboard bool ami_add_to_clipboard(const char *text, size_t length, bool space); static bool ami_copy_selection(const char *text, size_t length, @@ -166,7 +167,7 @@ bool gui_empty_clipboard(void) { if(!(PushChunk(iffh,ID_FTXT,ID_FORM,IFFSIZE_UNKNOWN))) { - if(option_utf8_clipboard) + if(option_utf8_clipboard || ami_utf8_clipboard) { if(!(PushChunk(iffh,0,ID_CSET,24))) { @@ -215,7 +216,7 @@ bool ami_add_to_clipboard(const char *text, size_t length, bool space) { char *buffer; - if(option_utf8_clipboard) + if(option_utf8_clipboard || ami_utf8_clipboard) { WriteChunkBytes(iffh,text,length); } @@ -346,6 +347,8 @@ void ami_drag_selection(struct selection *s) if(text_box = ami_text_box_at_point(gwin, &x, &y)) { + ami_utf8_clipboard = true; + iffh = ami_clipboard_init_internal(1); if(gui_copy_to_clipboard(s)) @@ -356,6 +359,7 @@ void ami_drag_selection(struct selection *s) ami_clipboard_free_internal(iffh); iffh = old_iffh; + ami_utf8_clipboard = false; } else { -- cgit v1.2.3