Fix http://bugs.xdebug.org/view.php?id=518 and let PHPEclipse works with xdebug 2.1
authorincastrix <incastrix>
Wed, 3 Nov 2010 15:32:39 +0000 (15:32 +0000)
committerincastrix <incastrix>
Wed, 3 Nov 2010 15:32:39 +0000 (15:32 +0000)
net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStringValue.java

index 58bcf24..1204035 100644 (file)
@@ -1,6 +1,7 @@
 package net.sourceforge.phpeclipse.xdebug.php.model;
 
 import net.sourceforge.phpeclipse.xdebug.core.Base64;
+import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
 
 import org.eclipse.debug.core.DebugEvent;
 import org.eclipse.debug.core.DebugException;
@@ -10,7 +11,10 @@ public class XDebugStringValue extends XDebugAbstractValue {
        public XDebugStringValue(XDebugStackFrame variable, Node value) throws DebugException {
                super(variable, value);
 
-               rowValue = new String(Base64.decode(rowValue));
+               String encoding = PHPDebugUtils.getAttributeValue(value, "encoding");
+               if (encoding.equals("base64")) {
+                       rowValue = new String(Base64.decode(rowValue));
+               }
 
                setValueString(rowValue);
        }