php.net |  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
Description:
------------
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:

- http://emsmith.net/gtk/php-5.3.15-nts-php-gtk-snapshot.zip
- http://emsmith.net/gtk/php-5.4.5-nts-php-gtk-snapshot.zip
- http://emsmith.net/gtk/php-gtk-2012-5.4-snapshot.zip

Old php-gtk package works (http://gtk.php.net/do_download.php?
download_file=php-gtk-2.0.1-win32-nts.zip)


Test script:
---------------
https://raw.github.com/php/php-gtk-src/master/demos/stock-browser.php

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-
browser.php:120
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-07 14:19 UTC] auroraeosrose@php.net
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
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php 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] auroraeosrose@php.net
-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 
issue.

Thanks for your help.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 21:01:26 2024 UTC