Bug #63892 [Fbk->Csd]: Stock browser demo exception with some locales

[email protected] ("gianluca dot faieta at gmail dot com") Thu, 10 Jan 2013 14:02:02 -0500
Newsgroups php.gtk.dev
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=63892&edit=1

 ID:                 63892
 User updated by:    gianluca dot faieta at gmail dot com
 Reported by:        gianluca dot faieta at gmail dot com
 Summary:            Stock browser demo exception with some locales
-Status:             Feedback
+Status:             Closed
 Type:               Bug
 Package:            PHP-GTK related
 Operating System:   Windows
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Setting php-gtk.codepage to either UTF-8 or ISO-8859-1 in php.ini fixes the 
issue.

Thanks for your help.


Previous Comments:
------------------------------------------------------------------------
[2013-01-07 14:19:54] [email protected]

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-03 08:19:31] 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



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63892&edit=1