From: David O. <Da...@di...> - 2002-10-15 15:37:01
Attachments:
patch.gaim.dindinx2
|
Hi, Just as I promise the other day, here is my first attempt to replace the entry part of a chat window (which is currently a GtkText) with a GtkTextBuffer/GtkTextView pair. I know it is ugly. I know it is work in progress. But, for basic text edition, it Works-For-Me(tm). Please let me know if it's ok for you too. I go back to work and add all the features the previous entry has... Regards, DindinX -- Da...@di... I think I'm schizophrenic. One half of me's paranoid and the other half's out to get him. |
From: Ethan B. <ebl...@cs...> - 2002-10-15 15:58:47
|
David Odin spake unto us the following wisdom: > + buf2 =3D g_locale_to_utf8(buf2, -1, NULL, NULL, NULL);*/ > + write_to_conv(c, g_locale_from_utf8(buf, -1, NULL, NULL, NULL), WFL= AG_SEND, NULL, time(NULL), -1); > + buf2 =3D g_locale_to_utf8(buf2, -1, NULL, NULL, NULL); > + write_to_conv(c, g_locale_from_utf8(buf, -1, NULL, NULL, NULL), WFL= AG_SEND, NULL, time(NULL), -1); > + textutf8 =3D g_locale_to_utf8(text, -1, NULL, NULL, NULL); These make me nervous ... input taken from a native gtk2 widget should *already* be UTF-8, and shouldn't have to be converted... If this isn't the case, something funky is going on here. Ethan --=20 And if I claim to be a wise man / it surely means that I don't know. -- Kansas, "Carry on Wayward Son" |
From: David O. <Da...@di...> - 2002-10-15 17:29:48
|
On Tue, Oct 15, 2002 at 10:56:39AM -0500, Ethan Blanton wrote: > David Odin spake unto us the following wisdom: > > + buf2 = g_locale_to_utf8(buf2, -1, NULL, NULL, NULL);*/ > Obviously, this one is inside a comment... > > + write_to_conv(c, g_locale_from_utf8(buf, -1, NULL, NULL, NULL), WFLAG_SEND, NULL, time(NULL), -1); > To send the message, we need to convert it from utf8 to locale, since the peer may not understand the utf8 encoding. But any way, this is not the reason for this (see below.) [1] > > + buf2 = g_locale_to_utf8(buf2, -1, NULL, NULL, NULL); > > > + write_to_conv(c, g_locale_from_utf8(buf, -1, NULL, NULL, NULL), WFLAG_SEND, NULL, time(NULL), -1); > These last two line are inside a function that shouldn't be called anyway, since the old c->entry isn't shown anymore. > > + textutf8 = g_locale_to_utf8(text, -1, NULL, NULL, NULL); > This is from gtkimhtml.c. Without this, any text I receive from a buddy is truncated at the first non-ascii character, because the text is certainly send as non-utf8 (fr_FR in this case...) And since this code is also used to display the text I type, I had to transform the text I type into locale from utf8, hence the change in [1] > These make me nervous ... input taken from a native gtk2 widget should > *already* be UTF-8, and shouldn't have to be converted... If this > isn't the case, something funky is going on here. > Yes, the input taken from the GtkTextBuffer is utf8, but the input taken from the aim buddies isn't. :-( Regards, DindinX -- Da...@di... To the systems programmer, users and applications serve only to provide a test load. |
From: Ethan B. <ebl...@cs...> - 2002-10-15 20:22:13
|
David Odin spake unto us the following wisdom: > On Tue, Oct 15, 2002 at 10:56:39AM -0500, Ethan Blanton wrote: > > David Odin spake unto us the following wisdom: > > > + buf2 =3D g_locale_to_utf8(buf2, -1, NULL, NULL, NULL);*/ > > > Obviously, this one is inside a comment... Oops. :-) > > > + write_to_conv(c, g_locale_from_utf8(buf, -1, NULL, NULL, NULL),= WFLAG_SEND, NULL, time(NULL), -1); > >=20 > To send the message, we need to convert it from utf8 to locale, since > the peer may not understand the utf8 encoding. But any way, this is not > the reason for this (see below.) [1] No, this is not correct. The peer should understand the encoding of the protocol, whatever that happens to be; at the UI level we have no idea what this encoding is. The protocol plugin will handle that, and the interface between the rest of gaim and a protocol plugin is now strictly UTF-8. For protocols that do not speak native UTF-8, e.g. Oscar, the character set conversion occurs in the protocol plugin. > > > + buf2 =3D g_locale_to_utf8(buf2, -1, NULL, NULL, NULL); > >=20 > > > + write_to_conv(c, g_locale_from_utf8(buf, -1, NULL, NULL, NULL),= WFLAG_SEND, NULL, time(NULL), -1); > >=20 > These last two line are inside a function that shouldn't be called > anyway, since the old c->entry isn't shown anymore. Fair enough. > > > + textutf8 =3D g_locale_to_utf8(text, -1, NULL, NULL, NULL); > >=20 > This is from gtkimhtml.c. Without this, any text I receive from a > buddy is truncated at the first non-ascii character, because the text is > certainly send as non-utf8 (fr_FR in this case...) No. This should not be happening. If you are receiving fr_FR (probably ISO-8859-1) text from a buddy, then either our prpl for that service is broken or your buddy is sending invalid IMs that just happened to work before because of our broken character set handling (or lack thereof). Personally, at this point I suspect your buddy's IMer. What program is your buddy using? If it is gaim pre-0.59.1 it is certainly broken. Other OSS IM clients are probably also broken. > And since this code is also used to display the text I type, I had to > transform the text I type into locale from utf8, hence the change in [1] See the above. :-) > > These make me nervous ... input taken from a native gtk2 widget should > > *already* be UTF-8, and shouldn't have to be converted... If this > > isn't the case, something funky is going on here. > >=20 > Yes, the input taken from the GtkTextBuffer is utf8, but the input > taken from the aim buddies isn't. :-( It most certainly is, and anything otherwise indicates a bug in one of the clients involved. Ethan --=20 And if I claim to be a wise man / it surely means that I don't know. -- Kansas, "Carry on Wayward Son" |