JSFiddle - React, Tailwind, and code Playground

by core972

JavaScript

var strList = ["%C3%BFLaser%20Gamme%20%C3%A9tabli%20FR%20cor2.indd:.90096:1190@label",
"#þÿLaser Gamme établi FR cor2.indd:.90096:1190@label",
"þÿ\u0000L\u0000a\u0000s\u0000e\u0000r\u0000 \u0000G\u0000a\u0000m\u0000m\u0000e\u0000 \u0000é\u0000t\u0000a\u0000b\u0000l\u0000i\u0000 \u0000F\u0000R\u0000 \u0000c\u0000o\u0000r\u00002\u0000.\u0000i\u0000n\u0000d\u0000d\u0000:\u0000.\u00001\u00000\u00008\u00004\u00000\u00005\u0000:\u00001\u00004\u00006\u00005"];

strList.forEach(function(str){
	console.log(1,decodeURIComponent(str));
  console.log(2,unescape(str));
  var newStr = [];
  var parsedStr = str.split(/\u/g);
  parsedStr.forEach(function(letter){
  	newStr.push(("\\u" + letter).codePointAt(0).toString(16));
  })
  console.log(3, newStr, parsedStr);
  console.log(4, String.fromCharCode(parseInt(str,16)))
});