UTF8 problems...
| From: | Pablo Dall'Oglio | Date: | Tue, 07 Feb 2006 00:16:01 +0000 |
| Subject: | UTF8 problems... | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-2352@lists.php.net to get a copy of this message | ||
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...
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