com gtk/php-gtk: Fix UTF8 Issue?: ext/scintilla/scintilla .overrides

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    aa5b9300444ae40696b004d86cdd386763216683
Author:    Anant Narayanan <[email protected]>         Wed, 5 Jul 2006 04:02:10 +0000
Parents:   3cdfe83a91bb54759227f2744267fde8c81d9eb3
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=aa5b9300444ae40696b004d86cdd386763216683

Log:
Fix UTF8 Issue?

Changed paths:
  M  ext/scintilla/scintilla.overrides


Diff:
aa5b9300444ae40696b004d86cdd386763216683
diff --git a/ext/scintilla/scintilla.overrides b/ext/scintilla/scintilla.overrides
index e3d0840..7959de2 100644
--- a/ext/scintilla/scintilla.overrides
+++ b/ext/scintilla/scintilla.overrides
@@ -42,26 +42,24 @@ PHP_METHOD
 override gtk_scintilla_set_text
 PHP_METHOD
 {
-    char *utf8;
-    gchar *text;
-
-    zend_bool free_utf8 = FALSE;
-    zend_bool free_text = FALSE;
-
-    gsize len = 0;
+    char *text, *utf8;
+    zend_bool free_text, free_utf8 = TRUE;
+    gsize len =  0;
 
     NOT_STATIC_METHOD();
 
-    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "s", &utf8, &free_utf8))
+    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "u", &utf8, &free_utf8))
         return;
     
     text = phpg_from_utf8(utf8, strlen(utf8), &len, &free_text TSRMLS_CC);
 
-    if (text && free_text) {
-        gtk_scintilla_set_text(GTK_SCINTILLA(PHPG_GOBJECT(this_ptr)), text);
-        g_free(text);
-    }
+    gtk_scintilla_set_text(GTK_SCINTILLA(PHPG_GOBJECT(this_ptr)), text);
 
-    if (free_utf8) 
+    if (free_utf8) {
         g_free(utf8);
+    }
+
+    if (free_text) {
+        g_free(text);
+    }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.