martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

base64 values should be decoded with proper encodings #150

Open risperdal opened 9 years ago

risperdal commented 9 years ago

base64 values should be decoded with proper encodings

base64 properties was always been decoded with base64.b64decode(data).decode('utf8')

which is a strict mode. It throws UnicodeDecodeError exception when the property value is not UTF-8

risperdal commented 9 years ago

To reproduce issue

utf8.php (save with encoding utf-8)

<?php
$utf_str = "ç ı ü ğ ö ş İ Ğ Ü Ö Ş Ç";

echo $utf_str;

include "win1254.php";
?>

save it to same folder win1254.php (save with encoding windows-1254)

<?php
$deneme = array('ÇOK GÜZELMİŞ' => 'şanlıurfa'); //put breakpoint here
$win1254_str = "ç ı ü ğ ö ş İ Ğ Ü Ö Ş Ç";
echo $win1254_str;
?>

put a breakpoint to win1254.php line 1 open a browser and locate to utf8.php and try to debug

risperdal commented 9 years ago

should solve issue #110

ryanpcmcquen commented 5 years ago

I would like to merge your fixes into my fork: https://github.com/ryanpcmcquen/SublimeTextXdebugPlus

Would you mind rebasing them against the master branch?

I am attempting to get my fork into Package Control: https://github.com/wbond/package_control_channel/pull/7658