You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the user guide: "On Firefox and IE, localStorage cannot contain invalid UTF16 characters."
I've tried the following code in Firefox to check that, and saw no problem at all:
for(lett=0;t<100;++t){console.log("t="+t);// Generate a 100K array with random 16-bit valuesletarray=[];for(leti=0;i<100000;++i)array.push(parseInt(Math.floor(Math.random()*65536)));// Convert it to an UTF-16 stringconstsrc=String.fromCharCode.apply(null,newUint16Array(array))// Store the string in localStoragelocalStorage._test_string=src;// Retrieve the string from localStorageconstdst=localStorage._test_string;// Check the localStorage content matches the original arrayfor(leti=0;i<100000;++i){if(dst.charCodeAt(i)!=array[i])console.warn("Failure for i="+i,dst.charCodeAt(i),array[i]);}// Remove the string from localStoragedeletelocalStorage._test_string;}
Is this limitation still valid? If so, how to replicate it? If not, the documentation should probably be updated to indicate this is not a problem anymore on recent versions of all browsers.
The text was updated successfully, but these errors were encountered:
From the user guide: "On Firefox and IE,
localStorage
cannot contain invalid UTF16 characters."I've tried the following code in Firefox to check that, and saw no problem at all:
Is this limitation still valid? If so, how to replicate it? If not, the documentation should probably be updated to indicate this is not a problem anymore on recent versions of all browsers.
The text was updated successfully, but these errors were encountered: