Re: gtk_editable clipbvoard or C clibpard




Mikael Hermansson <mikeh@bahnhof.se> writes:

> I just tried to paste some UTF-8 converted
> swedish characters into HELLO.utf8.
> 
> First I inserted text by using iconv routines and copy 
> converted text to XClipboard.
> 
> Loaded HELLO.utf8 to my gtkextext widget and pasted
> the UTF-8 characters from the X clipboard. 
> 
> After save, lets try render it with pango using:
> 
> pango-viewer HELLO.utf8 gives:
> 
> "Invalid character in input"
> 
> Looks like the clipboard corrupt the characters...
> Does this mean XClipboard dont like some of the codes between
> range >= 0x80 <= 0xFD used by UTF-8? 
> Or is it gtk_editable who dont like it?
> 
> for example:
> 
> sprintf(buf,"Copyright sign in UTF8 format = %c%c",0xC2,0xA9)
> 
> gtk_extext_insert(buf,...);
> gtk_editable_copy(...)  /* copy to XClipboard */ 
> gtk_editable_paste(..)  /* paste somewhere else */
> 
> Should this work without problems?

No, it shouldn't. The code in GtkEditable currently assumes that 
the contents of your buffer are encoded according to the 
current locale. 

You can transfer UTF8 encoded text on the X clipboard - 
see:

 http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/UTF8-selections.text

(Havoc's text widget has an example of handling both UTF8_STRING
 and old-style STRING). 

But gtkeditable does not currently handle this. In GTK+-1.4,
it will.

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]