php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45938 ? is not supported
Submitted: 2008-08-27 16:43 UTC Modified: 2008-08-27 18:54 UTC
From: saul_porras at live dot com dot mx Assigned:
Status: Not a bug Package: PHP-GTK related
PHP Version: 5.2.6 OS: windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: saul_porras at live dot com dot mx
New email:
PHP Version: OS:

 

 [2008-08-27 16:43 UTC] saul_porras at live dot com dot mx
Description:
------------
that is a small function however when i type ? ? ? ? ? it gives me the character ok i can even save it on to a mysql table fine.  but when i type ? it gives me a n i have tested it on many ways but i think that the get_text() function is giving me that error.

i use the php 5.2 and gtk 2.0.1 and older versions tested too

Reproduce code:
---------------
<?php
$window = new GtkWindow();
$window->set_size_request(400, 240);
$window->connect_simple('destroy', array('Gtk','main_quit'));
$window->add($vbox = new GtkVBox());

// display title
$title = new GtkLabel("setup entry");
$title->modify_font(new PangoFontDescription("Times New Roman Italic 10"));
$title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff"));
$title->set_size_request(-1, 40);
$vbox->pack_start($title, 0, 0);


$item_number = new GtkEntry();
$item_number->connect('insert-text', 'on_insert'); // note 1

$hbox = new GtkHBox();
$hbox->pack_start(new GtkLabel('Item Number: '), 0, 0);
$hbox->pack_start($item_number, 0, 0);
$vbox->pack_start($hbox);
$vbox->pack_start(new GtkLabel("Note: item numbers should contain only numbers 0 to 9"), 0, 0);

$window->show_all();
Gtk::main();

function on_insert($entry, $text, $len, $position) {
    $text = substr($text, 0, $len); // this is the new text inserted
    echo $text;
    return false; // yes, let the default handler display the number
}

?>

Expected result:
----------------
get_text show me the ?

Actual result:
--------------
shows a n

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-27 17:16 UTC] Keisial at gmail dot com
The ? works for me, here. I'm using the cvs version of php-gtk and gtk+ bundle 2.12.11. Try using newer verions of the gtk+ libs. Can you use the ? on other gtk+ powered apps?
 [2008-08-27 17:18 UTC] saul_porras at live dot com dot mx
sorry i am missing something that is one of the ways i tried to return the text from the gtk entry also tried get_text() and did not worked either then the gtk entry is not sending me the ? charactarer with any method
 [2008-08-27 17:20 UTC] saul_porras at live dot com dot mx
sorry did not saw your message,, were can i find the cvs version of php-gtk
 [2008-08-27 17:49 UTC] Keisial at gmail dot com
In CVS; obviously :)
See http://gtk.php.net/download.php at the bottom. You will need to compile it, which is not too easy on windows. I can send you the binaries if you prefer.
Still, I suspect it's a problem with the gtk libs and not php-gtk itself.
 [2008-08-27 18:14 UTC] saul_porras at live dot com dot mx
got  gtk lib 2.16.5 and still the same so if you could send me the binaries it will be great, thxs
 [2008-08-27 18:22 UTC] sfox@php.net
What is the codepage setting in your php.ini? (Look for 'php-gtk.codepage'.)
 [2008-08-27 18:34 UTC] saul_porras at live dot com dot mx
php-gtk.codepage = CP1250 this is what appears on the ini file

:)
 [2008-08-27 18:35 UTC] auroraeosrose@php.net
try changing that to utf-8
 [2008-08-27 18:52 UTC] saul_porras at live dot com dot mx
yep it works just fine thanks so much u save my life

php-gtk.codepage = "utf-8"
php-gtk.codepage = "ISO-8859-1"

both worked for me thanks
 [2008-08-27 18:54 UTC] auroraeosrose@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

you must set your character set properly in your php.ini (or php-cli.ini
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC