[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebindings/qtruby/rubylib/qtruby
From:       Alex Zepeda <zipzippy () sonic ! net>
Date:       2003-08-11 19:51:19
[Download RAW message or body]

CVS commit by garbanzo: 

Treat all Ruby strings as UTF-8 encoded strings.


  M +14 -12    handlers.cpp   1.20


--- kdebindings/qtruby/rubylib/qtruby/handlers.cpp  #1.19:1.20
@@ -425,21 +425,23 @@ static void marshall_QString(Marshall *m
       case Marshall::FromVALUE:
         {
-            QString *s = 0;
+            QString s;
             if(*(m->var()) != Qundef || m->type().isStack()) {
-                s = new QString( STR2CSTR(*(m->var())) );
-//               if(SvUTF8(*(m->var())))
-//                  s = new QString(QString::fromUtf8(SvPV_nolen(*(m->var()))));
-//                else if(PL_hints & HINT_LOCALE)
-//                    s = new QString(QString::fromLocal8Bit(SvPV_nolen(*(m->var()))));
-//                else
-//                    s = new QString(QString::fromLatin1(SvPV_nolen(*(m->var()))));
+#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 = QString::fromUtf8(STR2CSTR(*(m->var())) );
+#endif
             } else if(m->type().isRef()) {
-                s = new QString;
+                s = QString::null;
             }
                 
-            m->item().s_voidp = s;
+            m->item().s_voidp = &s;
             m->next();
-            if(s && m->cleanup())
-                delete s;
         }
         break;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic