Re: UTF8 problems...
| From: | Pablo Dall'Oglio | Date: | Tue, 07 Feb 2006 00:18:20 +0000 |
| Subject: | Re: UTF8 problems... | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2353@lists.php.net to get a copy of this message | ||
Em Seg, 2006-02-06 às 22:16 -0200, Pablo Dall'Oglio escreveu:
> This code below, gives me:
> (teste.php:8970): Pango-WARNING **: Invalid UTF-8 string passed to
> pango_layout_set_text()
>
> Everytime I pass the mouse cursor over accented characters
> Besides showing nothing besides the accented character in the list...
Besides showing nothing after...
>
> I know that using utf8_encode() solves the problem. But is there another
> workaround ?
>
> <?php
> $window = new GtkWindow;
> $window->set_default_size(200,200);
> $window->set_position(GTK::WIN_POS_CENTER);
>
> $list = new GtkTreeView;
>
> $model = new GtkListStore(Gtk::TYPE_STRING);
> $list->set_model($model);
>
> $column1 = new GtkTreeViewColumn();
>
> $cell_renderer1 = new GtkCellRendererText();
> $column1->pack_start($cell_renderer1, true);
>
> $column1->set_attributes($cell_renderer1, 'text', 0);
>
> $list->append_column($column1);
>
> $data[] = array('Pedro');
> $data[] = array('Maria');
> $data[] = array('José');
> $data[] = array('Automóvel');
> $data[] = array('João');
>
> foreach ($data as $copa)
> {
> $iter = $model->append($copa);
> }
>
> $window->add($list);
> $window->show_all();
> Gtk::Main();
> ?>
> --
> :: Pablo Dall'Oglio
> :: www.dalloglio.net
>
--
:: Pablo Dall'Oglio
:: www.dalloglio.net