Kartik Visweswaran 10 лет назад
Родитель
Сommit
1041bcacee
4 измененных файлов с 7 добавлено и 2 удалено
  1. 1 0
      CHANGE.md
  2. 3 0
      README.md
  3. 3 2
      js/fileinput.js
  4. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -4,6 +4,7 @@ version 4.1.1
 
 1. (bug #76): Update filestack when `showPreview` is false.
 2. (bug #78): Set uploadExtraData parameters to be correctly sent via POST.
+3. (enh #58): Set a new property `textEncoding` for reading the text files with right encoding.
 
 version 4.1.0
 =============

+ 3 - 0
README.md

@@ -816,6 +816,9 @@ Defaults to the following setting:
 }
 ```
 
+#### textEncoding
+_string_ the encoding to be used while reading a text file. Applicable only for previewing text files. Defaults to `UTF-8`. 
+
 ### Plugin Events
 The plugin supports these events:
 

+ 3 - 2
js/fileinput.js

@@ -1266,7 +1266,7 @@
                         }
                     };
                     if (isText(file.type, caption)) {
-                        reader.readAsText(file);
+                        reader.readAsText(file, self.textEncoding);
                     } else {
                         reader.readAsArrayBuffer(file);
                     }
@@ -1573,7 +1573,8 @@
         dropZoneEnabled: true,
         dropZoneTitle: 'Drag & drop files here …',
         dropZoneTitleClass: 'file-drop-zone-title',
-        fileActionSettings: {}
+        fileActionSettings: {},
+        textEncoding: 'UTF-8'
     };
 
     /**

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
js/fileinput.min.js


Некоторые файлы не были показаны из-за большого количества измененных файлов