Menu

#6 Bad UFT-8 text in OSD

open
nobody
5
2004-09-22
2004-09-22
Anonymous
No

When displaying strings with internationalized
characters, these show up in the OSD text as their
1-byte equivalents in some encoding.

I don't know if the encoding used is the one selected
with the font-string in the preferences window... What
I know is that Gaim (as any GTK2 app) uses UTF-8 for
its internal string representation, and I can't select
any "UTF-8-font-encoding" that makes international
characters look good.

Is this a gaimosd or an xosd limitation?

May it be solved by doing UTF-8 -> whatever encoding
conversion in the plugin?

Thanks in advance,

Juan Jesús.

Discussion

  • Etan Reisner

    Etan Reisner - 2004-11-02

    Logged In: YES
    user_id=516184

    I'm not certain as to the problem with this, I'd have to
    test it some before I was sure, but gaimosd and xosd don't
    (as far as I know off the top of my head) pay any attention
    to the locale settings in gaim, and probably don't pay any
    attention to locale settings anywhere else either. I would
    suggest making sure that the font you have given to gaimosd
    to use for the display supports the characters you are
    intending it to display.

     
  • Nobody/Anonymous

    Logged In: NO

    I think that this bug is located in GaimOsd itself and NOT
    font either xosd.

    Tests on Gentoo with:

    - gtk+-2.4.9-r1

    - xosd-2.2.12

    - gaim-1.0.3-r2

    - gaimosd-1.0.0

    - xmms-1.2.10-r5

    - libxmms_osd.so ver 2.2.12

    and UTF-8 font

    -microsoft-tahoma-medium-r-normal-*-20-*-*-*-p-*-tis620-2

    showed that the same text "żłw" (in fact iso8895-2)
    displayed
    with xmms + xmmsosd was displayed correctly

    and

    with gaim + gaimosd was displayed INCORRECTLY

    Both plugins are linked with the same libxosd.so.2 =>
    /usr/lib/libxosd.so.2 (0xb7fe4000).

    Szef
    <A
    href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#115;&#122;&#101;&#102;&#54;&#54;&#54;&#64;&#112;&#114;
    &#105;&#118;&#46;&#111;&#110;&#101;&#116;&#46;&#61;&#85;&#83;&#85;&#78;&#95;&#84;&#79;&#61;&#112;&#108;">&#115;&#122;
    &#101;&#102;&#54;&#54;&#54;&#64;&#112;&#114;&#105;&#118;&#46;&#111;&#110;&#101;&#116;&#46;&#61;&#85;&#83;&#85;&#78;&#
    95;&#84;&#79;&#61;&#112;&#108;</a>

     
  • Etan Reisner

    Etan Reisner - 2004-12-06

    Logged In: YES
    user_id=516184

    What protocol are you getting this message on that it's not
    working for? And what (if any) Encoding do you have set for
    that account (in the account options dialog)? And what
    characters were those supposed to be?

     
  • Nobody/Anonymous

    Logged In: NO

    Hello deryni9.
    The described issue occured for sure in protocols: Jabber
    and Gadu-Gadu athough I've not tested others.
    Those protocols didn't have any encoding in their properities.
    Locales are set to:
    LANG=pl_PL
    LANGUAGE=pl_PL
    LC_ALL=pl_PL

    Setting fixed string in properities of Gaim OSD plugin i.e.

    Events/Message Received/ "Fixed teststring &#380;&#322;w zolw
    /message "%m"
    gave the same results so it might be protocol independent
    behaviour.

    Typed characters were &#380;&#322;w, that stands for
    &#380;=0xBF =0xF3 &#322;=0xB3 w=0x77

    screenshot available at http://tiny.pl/4h5

    Szef: szef666[]priv.onet.pl

     
  • Jan Hudec

    Jan Hudec - 2005-01-23

    Logged In: YES
    user_id=977494

    libxosd tries to be more clever than it should and converts the text
    from locale encoding to the font encoding. Starting gaim with utf-8
    locale fixes the problem. I'll file a feature-request (and maybe make a
    patch) for libxosd to support explicit encodings.

     
  • Nobody/Anonymous

    Logged In: NO

    http://pastebin.com/519856

    this fix should help

     
  • Nobody/Anonymous

    Logged In: NO

    As I already wrote. The problem is there when you run gaim
    with ISO-8869-2 (or anything else non-unicode) locale and
    is NOT there when you run gaim with UTF-8 locale.

    I actually LOOKED at the xosd code back then (it's a year
    ago!). It is Xlib that actually does the conversion. There
    are two functions, XmbDrawString and Xutf8DrawString. The
    former expects locale-encoded string, the later expects
    utf-8 string. Libxosd uses the former in _draw_text at
    xosd.c line 190 (as of 2.2.14). If there was a way to tell
    it to use Xutf8DrawString instead, Gaim would do the right
    thing.

    Note: For me the account is a Jabber one and as such is
    always utf-8, since that is part of the protocol
    specification.

     
  • Jan Hudec

    Jan Hudec - 2006-01-24

    Logged In: YES
    user_id=977494

    Um, about that patch, http://pastebin.com/519856, yes, it
    could help, except not completely. The thing is, that if
    xosd has a unicode font and the account is utf-8 (eg.
    jabber always is), but the current locale is not, than some
    characters won't display because they don't have
    representation in locale encoding, though they are
    available in the font.

    Proper fix would probably be to request the functionality
    from libxosd.

     

Log in to post a comment.