|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63892 Stock browser demo exception with some locales
Submitted: 2013-01-03 08:19 UTC Modified: 2013-01-10 19:02 UTC
From: gianluca dot faieta at gmail dot com Assigned:
Status: Closed Package: PHP-GTK related
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
 [2013-01-03 08:19 UTC] gianluca dot faieta at gmail dot com
The stock icons browser from php-gtk-src demos throws exception when run under 
italian, spanish and french locales (Control Panels > Region and Language). It 
works normally when run under english, german and dutch locales.

The script was tested on Windows Server 2008 SP2, Windows XP SP2 and Windows 7 
with same error. Multiple PHP binaries were tested, with same outcome:


Old php-gtk package works (

Test script:

Actual result:
Warning: Could not convert item label from UTF-8 in C:\zdemos\stock-browser.php 
on line 120

Fatal error: Uncaught exception 'PhpGtkGErrorException' with message 'Sequenza di 
byte non valida nell'ingresso per la conversione' in C:\zdemos\stock-
Stack trace:
#0 C:\zdemos\stock-browser.php(120): Gtk::stock_lookup('gtk-go-down')
#1 C:\zdemos\stock-browser.php(52): StockItemBrowserDemo->create_model()
#2 C:\zdemos\stock-browser.php(253): StockItemBrowserDemo->__construct()
#3 {main}
  thrown in C:\zdemos\stock-browser.php on line 120


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-07 14:19 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Do you have the correct ini setting for php-gtk?  This WILL not work unless you change your php-gtk.codepage = UTF-8 in php-cli.ini

What is happening is gtk can't convert the string given by the localization to the codepage you have set in your ini, and then PHP is fatal erroring because the string has invalid bytes
 [2013-01-07 14:19 UTC]
-Status: Open +Status: Feedback
 [2013-01-10 19:02 UTC] gianluca dot faieta at gmail dot com
-Status: Feedback +Status: Closed
 [2013-01-10 19:02 UTC] gianluca dot faieta at gmail dot com
Setting php-gtk.codepage to either UTF-8 or ISO-8859-1 in php.ini fixes the 

Thanks for your help.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 00:01:29 2024 UTC