bvasiles / jsNaughty

JS reverse minifier based on statistical machine translation
21 stars 2 forks source link

Unicode In Strings Crashing Renamer #1

Closed caseycas closed 7 years ago

caseycas commented 7 years ago

The Popen.communicate call is failing when there are unicode escape characters in the Javascript passed in. For instance, ` writeRandomQuote = function() { var e = new Array(); e[0] = "Action is the real measure of intelligence."; e[1] = "Baseball has the great advantage over cricket of being sooner ended."; e[2] = "Every goal, every action, every thought, every feeling one experiences, whether it be consciously or unconsciously known, is an attempt to increase one’s level of peace of mind."; e[3] = "A good head and a good heart are always a formidable combination."; var o = Math.floor(Math.random() * e.length); document.write(e[o]); };

writeRandomQuote(); ` Causes a crash. This is despite it already having been encoded in utf8 (e.g. it prints file elsewhere.)

bvasiles commented 7 years ago

Solved temporarily by transliteration with unidecode.