server/python/django/renkanmanager/static/renkanmanager/lib/FileSaver/FileSaver.js
changeset 435 e529b633c339
parent 429 6103b7192d38
child 456 a3bf10beb710
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/FileSaver/FileSaver.js	Sat Apr 25 04:37:06 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/FileSaver/FileSaver.js	Mon Apr 27 17:22:46 2015 +0200
@@ -1,6 +1,6 @@
 /* FileSaver.js
  * A saveAs() FileSaver implementation.
- * 2014-12-17
+ * 2015-03-04
  *
  * By Eli Grey, http://eligrey.com
  * License: X11/MIT
@@ -135,6 +135,10 @@
 				revoke(object_url);
 				return;
 			}
+			// prepend BOM for UTF-8 XML and text/plain types
+			if (/^\s*(?:text\/(?:plain|xml)|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
+				blob = new Blob(["\ufeff", blob], {type: blob.type});
+			}
 			// Object and web filesystem URLs have a problem saving in Google Chrome when
 			// viewed in a tab, so I force save with application/octet-stream
 			// http://code.google.com/p/chromium/issues/detail?id=91158
@@ -236,7 +240,7 @@
 // with an attribute `content` that corresponds to the window
 
 if (typeof module !== "undefined" && module.exports) {
-  module.exports = saveAs;
+  module.exports.saveAs = saveAs;
 } else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) {
   define([], function() {
     return saveAs;