satazor / js-spark-md5

Lightning fast normal and incremental md5 for javascript
Do What The F*ck You Want To Public License
2.46k stars 470 forks source link

'unescape' is deprecated #28

Closed cristi-badila closed 8 years ago

cristi-badila commented 8 years ago

I noticed that in the toUtf8 function you are using the unescape method which was deprecated. Wouldn't using decodeURIComponent achieve the same goal?

satazor commented 8 years ago

decodeURIComponent is already there, but both need to be used, see: http://ecmanaut.blogspot.pt/2006/07/encoding-decoding-utf8-in-javascript.html

Browser's can't simply remove methods from their engine otherwise they would break a lot of sites, see this comment: http://ecmanaut.blogspot.pt/2006/07/encoding-decoding-utf8-in-javascript.html#comment-785303118

If they ever remove it, I will either polyfill the method or do it in plain JavaScript.