[Koha-bugs] [Bug 8963] Can not upload csv file for Quote of the day

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Nov 7 17:37:58 CET 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8963

--- Comment #1 from Marc Véron <veron at veron.ch> ---
Update:

I did a test by changing the code after "sanity check" in
koha-tmpl/intranet-tmpl/prog/en/modules/toolsto accept .txt files as well.

While this would provide a workaround, I got an other glitch: 

If the file is not UTF-8 encoded, you get garbled characters with umlauts etc.

This is due to following line (no encoding paramter given):

reader.readAsText(evt.target.files[0]);

FileReader.readAsText(File, encoding) defaults to encoding = "UTF-8".

It seems to be difficult to determine the file's encoding for use param, see:
http://stackoverflow.com/questions/10338235/javascript-reading-local-text-file-charset-issue

--snip----
You'd need to analyze the raw binaries of the text file to have a best guess at
what the encoding is. There isn't any libraries for this in javascript AFAIK
but you could port one from other languages.

Since that isn't very robust, you should also provide a manual override like
Characters not showing correctly? Change encoding:
--snip----

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list