decodeURIé¢æ°ã®åä½ã§ãã©ã¦ã¶å¤å¥
function getBrowserNameByDecodeURI() { //Firefox's decodeURI decodes percent-encoded U+FFFF and U+FFFE as U+FFFD if (decodeURI("%EF%BF%BF") == "\uFFFD") { try { //see http://d.hatena.ne.jp/masa141421356/20091009 decodeURI("%F0%81%80%80"); return "Firefox 3.5 or older"; } catch (e) { return "Firefox 3.6"; } } try { if (decodeURI("%C0%80")=="%C0%80") { //Opera's bug DSK-298518 return "Opera 10.x or Older"; } return "IE"; } catch (e) { //ECMAScript5 requires to throw URIError for percent-encoded overlong UTF-8 try { //ECMAScript5 also requires to throw URIError for //single surrogate code. //But, some browsers do not throw URIError. // see http://d.hatena.ne.jp/Constellation/20110530/1306759498 if (decodeURI("%ED%A0%80")=="\uFFFD") { return "Opera 11.60"; } return "Google Chrome (current)or Opera 11.0-11.50 or Firefox 4-7"; } catch (e) { //If implementation of decodeURI is ECMAScript5 compliant, this code will be executed. return "Safari or Firefox 8(or later) or Google Chrome (after V8 issue 1415 fixed)"; } } }
2011/06/12 追è¨
id:Constellation ããããsurrogate code ã使ã£ãå¤å¥æ¹æ³ãæãã¦ããã ããã®ã§å¤å¥é¨åã追å ãã¾ããã
2011/10/27追è¨
ãµãã²ã¼ãã¨ãªã¢ã®åé¡ã®ä¿®æ£ããããå ¥ã£ããããã®ã§ãã®åãåæ
2011/12/21追è¨
Opera11.60ã®åä½ãå¤ãã£ãã®ã§ãã®åãåæ