[Kde-bindings] playground/bindings/kimono

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Feb 3 13:38:00 UTC 2007


SVN commit 629681 by rdale:

* The default format of a string in mono is utf8, and so assume that when
  converting to and from QStrings.

CCMAIL: kde-bindings at kde.org



 M  +2 -0      ChangeLog  
 M  +3 -22     handlers.cpp  


--- trunk/playground/bindings/kimono/ChangeLog #629680:629681
@@ -26,6 +26,8 @@
 	  transparent proxy for static method invocations.
 	* The SmokeClass Attribute is now used for the name of the class to use
 	  when looking up methods in the Smoke library
+	* The default format of a string in mono is utf8, and so assume that when
+	  converting to and from QStrings.
 
 2007-01-03  Richard Dale  <rdale at foton.es>
 
--- trunk/playground/bindings/kimono/handlers.cpp #629680:629681
@@ -495,14 +495,14 @@
 void *
 StringToQString(char *str)
 {
-	QString * result = new QString((const char *) str);
+	QString * result = new QString(QString::fromUtf8(str));
 	return (void *) result;
 }
 
 char *
 StringFromQString(void *ptr)
 {
-    QByteArray ba = ((QString *) ptr)->toLatin1();
+    QByteArray ba = ((QString *) ptr)->toUtf8();
     return strdup(ba.constData());
 }
 
@@ -807,17 +807,6 @@
 	    QString* s = 0;
 	    if( m->var().s_voidp != 0) {
 			s = (QString *) (*IntPtrToQString)(m->var().s_voidp);
-#if 0
-               if(SvUTF8(*(m->var())))
-                    s = QString::fromUtf8(SvPV_nolen(*(m->var())));
-               else if(PL_hints & HINT_LOCALE)
-                    s = QString::fromLocal8Bit(SvPV_nolen(*(m->var())));
-               else
-                    s = QString::fromLatin1(SvPV_nolen(*(m->var())));
-#else
-            // Treat everything as UTF-8..for now
-//            s = new QString(QString::fromUtf8(StringValuePtr(*(m->var())), RSTRING(*(m->var()))->len));
-#endif
             } else {
                 s = new QString(QString::null);
             }
@@ -843,15 +832,7 @@
 			} else {
 				m->var().s_class = (*IntPtrFromQString)(s);
 			}
-//                if(!(PL_hints & HINT_BYTES))
-//                {
-//		    sv_setpv_mg(m->var(), (const char *)s->utf8());
-//                    SvUTF8_on(*(m->var()));
-//                }
-//                else if(PL_hints & HINT_LOCALE)
-//                    sv_setpv_mg(m->var(), (const char *)s->local8Bit());
-//                else
-//                    sv_setpv_mg(m->var(), (const char *)s->latin1());
+
 			if (m->cleanup())
 				delete s;
 			} else {



More information about the Kde-bindings mailing list