[Ruby-gnome2][Bug] segmentation fault with ComboBox and spanish characters

Discussion in 'Ruby' started by David Espada, Mar 3, 2004.

  1. David Espada

    David Espada Guest

    Hi all.

    I have a little problem when setting a list of options in a ComboBox
    with spanish characters. When I type and complete with Alt+Tab,
    program goes inestable, crashing after a moment or making impossible
    to type more.

    When executing from console, I get critical messages about Bonobo and
    UTF-8 characters, like:

    ** (dequebarrio:1770): WARNING **: Invalid UTF8 string passed
    to pango_layout_set_text()

    I use Ruby 1.8.1 and Ruby-gnome2 0.8.1-8 in Debian Sid. Has any of
    you same problem? Is it a question solved in 0.9 version?

    Thanks a lot for your excellent work.

    David

    P.D. Sorry for not using mailing list, but I have problems sending
    messages to ruby-gnome2-devel-en.
     
    David Espada, Mar 3, 2004
    #1
    1. Advertising

  2. David Espada

    Masao Mutoh Guest

    Re: [Ruby-gnome2][Bug] segmentation fault with ComboBox and spanishcharacters

    Hi,

    On Wed, 3 Mar 2004 18:54:45 +0900
    David Espada <> wrote:

    > Hi all.
    >
    > I have a little problem when setting a list of options in a ComboBox
    > with spanish characters. When I type and complete with Alt+Tab,
    > program goes inestable, crashing after a moment or making impossible
    > to type more.


    > When executing from console, I get critical messages about Bonobo and
    > UTF-8 characters, like:
    >
    > ** (dequebarrio:1770): WARNING **: Invalid UTF8 string passed
    > to pango_layout_set_text()
    >
    > I use Ruby 1.8.1 and Ruby-gnome2 0.8.1-8 in Debian Sid. Has any of
    > you same problem? Is it a question solved in 0.9 version?


    What charset do you use ?
    All strings you pass to GTK+ functions must be in UTF-8.

    See http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_i18n

    > P.D. Sorry for not using mailing list, but I have problems sending
    > messages to ruby-gnome2-devel-en.


    Don't mind ;).

    --
    :% Masao Mutoh<>
     
    Masao Mutoh, Mar 3, 2004
    #2
    1. Advertising

  3. David Espada

    David Espada Guest

    El miércoles 03 de marzo, Masao Mutoh escribió:
    >> I have a little problem when setting a list of options in a ComboBox
    >> with spanish characters. When I type and complete with Alt+Tab,
    >> program goes inestable, crashing after a moment or making impossible
    >> to type more.

    >
    > What charset do you use ?


    UTF-8

    I pass data received from a database with UTF-8 coding. It works
    normally on other widgets without problems.

    > All strings you pass to GTK+ functions must be in UTF-8.


    Problem seems only to raise when I try using autocomplete with
    Alt+Tab

    > See http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_i18n


    Good. I'll read. Thanks.

    David
     
    David Espada, Mar 3, 2004
    #3
  4. David Espada

    Masao Mutoh Guest

    Re: [Ruby-gnome2][Bug] segmentation fault with ComboBox and spanishcharacters

    Hi,

    On Thu, 4 Mar 2004 00:34:44 +0900
    David Espada <> wrote:

    > >> I have a little problem when setting a list of options in a ComboBox
    > >> with spanish characters. When I type and complete with Alt+Tab,
    > >> program goes inestable, crashing after a moment or making impossiblea
    > >> to type more.

    > >
    > > What charset do you use ?

    >
    > UTF-8
    >
    > I pass data received from a database with UTF-8 coding. It works
    > normally on other widgets without problems.
    >
    > > All strings you pass to GTK+ functions must be in UTF-8.

    >
    > Problem seems only to raise when I try using autocomplete with
    > Alt+Tab


    Autocomplete ? Is it Gtk::Combo?

    Hmm. I don't know Gtk::Combo has autocomplete feature.
    Is it about other Widget?

    Could you send a sample(small one, please;->)?

    --
    :% Masao Mutoh<>
     
    Masao Mutoh, Mar 3, 2004
    #4
  5. David Espada

    David Espada Guest

    El miércoles 03 de marzo, Masao Mutoh escribió:
    >> > All strings you pass to GTK+ functions must be in UTF-8.

    >>
    >> Problem seems only to raise when I try using autocomplete with
    >> Alt+Tab

    >
    > Autocomplete ? Is it Gtk::Combo?


    Yes :)

    > Hmm. I don't know Gtk::Combo has autocomplete feature.
    > Is it about other Widget?


    Try yourself with a number of assigned values (set_popdown_strings)
    and Alt+Tab ;)

    > Could you send a sample(small one, please;->)?


    Well. In this example, you can select perfectly a value in combo with
    mouse, but if you type until a special spanish character and next use
    Alt+Tab combination in order to auto-complete word, widget run
    unstable and it is difficult to select a value until you type
    backspace repeatedly.

    Code:
    --------------------------------------------------------------
    #!/usr/bin/ruby

    require 'glib2'
    require 'gtk2'

    Gtk::init

    ventana = Gtk::Window.new
    ventana.set_title("Problemas con carácteres latinos")
    ventana.signal_connect('delete_event') {exit}


    vbox = Gtk::VBox::new(true, 10)

    boton = Gtk::Button.new('_cerrar', true)
    boton.signal_connect('clicked') do Gtk::main_quit end

    entra = Gtk::Entry.new()
    entra.set_text("This widget works perfectly: áéíóúñññ")

    combo = Gtk::Combo.new()
    combo.set_popdown_strings(['árbol', 'película', 'edredón'])
    combo.set_use_arrows(false)
    combo.set_value_in_list(true, true)

    vbox.pack_start(entra, true, true, 0)
    vbox.pack_start(combo, true, true, 0)
    vbox.pack_start(boton, true, true, 0)

    ventana.add(vbox)

    ventana.show_all

    Gtk.main
    --------------------------------------------------------

    Special characters are in UTF-8. If you have any problem to probe,
    I'll send you file.

    Thanks.

    David
     
    David Espada, Mar 4, 2004
    #5
  6. David Espada

    Masao Mutoh Guest

    Re: [Ruby-gnome2][Bug] segmentation fault with ComboBox and spanishcharacters

    --Multipart=_Fri__5_Mar_2004_03_37_14_+0900_Lk4NEqDcNTuuY0oz
    Content-Type: text/plain; charset=US-ASCII
    Content-Transfer-Encoding: 7bit

    Hi,

    On Thu, 4 Mar 2004 17:20:58 +0900
    David Espada <> wrote:

    > >> > All strings you pass to GTK+ functions must be in UTF-8.
    > >>
    > >> Problem seems only to raise when I try using autocomplete with
    > >> Alt+Tab

    > >
    > > Autocomplete ? Is it Gtk::Combo?

    >
    > Yes :)
    >
    > > Hmm. I don't know Gtk::Combo has autocomplete feature.
    > > Is it about other Widget?

    >
    > Try yourself with a number of assigned values (set_popdown_strings)
    > and Alt+Tab ;)
    >
    > > Could you send a sample(small one, please;->)?

    >
    > Well. In this example, you can select perfectly a value in combo with
    > mouse, but if you type until a special spanish character and next use
    > Alt+Tab combination in order to auto-complete word, widget run
    > unstable and it is difficult to select a value until you type
    > backspace repeatedly.


    GTK+ C version gets same result.
    It seems a bug of GTK+. Try attached file.

    gcc -o test `pkg-config gtk+-2.0 --libs --cflags` test.c

    --
    :% Masao Mutoh<>


    --Multipart=_Fri__5_Mar_2004_03_37_14_+0900_Lk4NEqDcNTuuY0oz
    Content-Type: application/octet-stream;
    name="test.c"
    Content-Disposition: attachment;
    filename="test.c"
    Content-Transfer-Encoding: base64

    I2luY2x1ZGUgPGd0ay9ndGsuaD4KI2luY2x1ZGUgPGxvY2FsZS5oPgoKaW50IG1haW4oaW50IGFy
    Z2MsIGNoYXIqKiBhcmd2KXsgIAogIEd0a1dpZGdldCAqd2luZG93LCAqY29tYm87CiAgR0xpc3Qq
    IGdsaXN0ID0gTlVMTDsKCiAgc2V0bG9jYWxlKExDX0FMTCwgIiIpOwogIGdsaXN0ID0gZ19saXN0
    X2FwcGVuZChnbGlzdCwgIsOhcmJvbCIpOwogIGdsaXN0ID0gZ19saXN0X2FwcGVuZChnbGlzdCwg
    InBlbMOtY3VsYSIpOwogIGdsaXN0ID0gZ19saXN0X2FwcGVuZChnbGlzdCwgImVkcmVkw7NuIik7
    CgogIGd0a19pbml0KCZhcmdjLCAmYXJndik7CgogIGNvbWJvID0gZ3RrX2NvbWJvX25ldygpOwoK
    ICBndGtfY29tYm9fc2V0X3BvcGRvd25fc3RyaW5ncyhHVEtfQ09NQk8oY29tYm8pLCBnbGlzdCk7
    CgogIHdpbmRvdyA9IGd0a193aW5kb3dfbmV3KEdUS19XSU5ET1dfVE9QTEVWRUwpOwogIGd0a19j
    b250YWluZXJfYWRkKEdUS19DT05UQUlORVIgKHdpbmRvdyksIEdUS19XSURHRVQoY29tYm8pKTsK
    ICBndGtfd2lkZ2V0X3Nob3dfYWxsKHdpbmRvdyk7CgogIGd0a19tYWluKCk7CiAgcmV0dXJuIDA7
    Cn0KCg==

    --Multipart=_Fri__5_Mar_2004_03_37_14_+0900_Lk4NEqDcNTuuY0oz--
     
    Masao Mutoh, Mar 4, 2004
    #6
  7. David Espada

    David Espada Guest

    El jueves 04 de marzo, Masao Mutoh escribió:
    >> Well. In this example, you can select perfectly a value in combo with
    >> mouse, but if you type until a special spanish character and next use
    >> Alt+Tab combination in order to auto-complete word, widget run
    >> unstable and it is difficult to select a value until you type
    >> backspace repeatedly.

    >
    > GTK+ C version gets same result.
    > It seems a bug of GTK+. Try attached file.


    Same problem. I suspected it ;)

    It seems that problem has not been reported to Gtk bugzilla nor Debian
    bug database. I'll write a report.

    Thanks, Masao.

    David
     
    David Espada, Mar 5, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Espada
    Replies:
    2
    Views:
    169
    David Espada
    Jul 1, 2004
  2. Replies:
    2
    Views:
    245
  3. Nate Younger
    Replies:
    0
    Views:
    127
    Nate Younger
    Dec 1, 2006
  4. scott
    Replies:
    5
    Views:
    234
    Luis Lavena
    Oct 5, 2008
  5. Replies:
    5
    Views:
    509
    Roedy Green
    Oct 11, 2012
Loading...

Share This Page