Koha/admin
Tomas Cohen Arazi 40d3800cc4 Bug 9114: Make frameworks import/export routines correctly use UTF-8
Currently both the import_export_framework.pl script outputs data with
Perl's default encoding, ISO-8859. This patch properly sets
the binmode to UTF-8 when exporting SQL and CSV files using the PerlIO
layer (":encoding(UTF-8)") for STDOUT.

To test:

Export step test
- Use some ASCII character(s) with DIACRITICS in some field description
  in a chosen framework.
- Export the framework at Administration > MARC frameworks
- Run this to check the file is ISO-8859 encoded:
 $ file export_XXX.csv
 export_XXX.csv: ISO-8859 text, with very long lines
 (Note: try SQL and other output formats too. But not ODS)
- Apply the patch
- Export the framework again (change the name), and test encoding:
 $ file export_XXX_2.csv
 export_XXX_2.csv: UTF-8 Unicode text

Import step test
I assume you have two files, export_XXX.csv (ISO-8859 encoded) and
export_XXX_2.csv (XXX will depend on your framework's code)
- Reset your testing branch to master
- Import export_XXX.csv
- The string with non-ASCII chars is truncated at the first non-ASCII
  char's position (Note: this is the current behaviour).
- Import export_XXX_2.csv
- The non-ASCII chars are broken, the logs show errors on non-UNICODE
  chars.  (Note: even thou UTF-8 is the expected encoding it is
  treated as ISO-8859).
- Apply the patch
- Import the good (UTF-8 as expected) file and check everything worked
  as expected.

No double encoding should occur with either combination of formats.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
I put some Norwegian and accented letters in a fremawork to test.
Before the patch, the exported CSV came out as ISO-8859, after the
patch it came out as UTF-8. ODS and XML (viewed in LibreOffice)
both looked good, before and after the patch.

Importing the ISO-8859 CSV cut off the strings at the first non-ASCII
char. Importing the UTF-8 CSV worked as epected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-03-14 14:37:31 +00:00
..
searchengine/solr Bug 8233 : SearchEngine: Add a Koha::SearchEngine module 2012-07-06 16:51:58 +02:00
admin-home.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
aqbudget_user_search.pl Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
aqbudgetperiods.pl Bug 9108: Followup: send the dateformat value from C4::Auth 2013-01-17 21:59:30 -05:00
aqbudgets.pl Bug 11166: make library filter in funds administration page more precise 2013-12-20 22:49:47 +00:00
aqcontract.pl Bug 8913 [Revised] Improve acquisitions navigation 2013-02-20 09:17:21 -05:00
aqplan.pl Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
auth_subfields_structure.pl Bug 11286: fix bug preventing adding a new subfield to an authority framework 2013-11-27 18:07:17 +00:00
auth_tag_structure.pl Bug 11767 - Use validation plugin when creating new authority framework tag 2014-02-19 15:51:12 +00:00
authorised_values.pl Bug 9307: QA Followup 2013-06-19 07:19:39 -07:00
authtypes.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
biblio_framework.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
branch_transfer_limits.pl Bug 6842 FU : library transfer limits edits not stored 2012-02-01 22:47:56 +01:00
branches.pl Bug 10515: make behavior of library category fetchers consistent with other fetchers 2013-07-17 17:27:24 +00:00
categorie.pl Bug 11513: fix log warning noise in patron category editor 2014-01-31 16:15:09 +00:00
check_budget_parent.pl Bug 5385: POD Cleanups (part 1) 2010-11-12 10:06:55 +13:00
check_parent_total.pl Bug 11675: check allocated total correctly when editing a fund that has a parent fund 2014-03-11 17:09:31 +00:00
checkmarc.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
cities.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
classsources.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
clone-rules.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
currency.pl Bug 8907 - Last updated date does not appear on currency edit form 2012-10-24 17:58:49 +02:00
didyoumean.pl Bug 8726: ExplodedTerms suggestion plugin (functionality) 2012-09-28 17:08:21 +02:00
env_tz_test.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
fieldmapping.pl Bug 8713 - Warning message triggered by clicking Keywords to MARC mapping 2012-09-17 18:48:21 +02:00
import_export_framework.pl Bug 9114: Make frameworks import/export routines correctly use UTF-8 2014-03-14 14:37:31 +00:00
item_circulation_alerts.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
itemtypes.pl Bug 11163: display correct itemtype usage count when deleting an itemtype 2013-11-15 15:34:33 +00:00
koha2marclinks.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
marc_subfields_structure.pl Bug 8018: (followup) make the default more explicit 2013-12-27 00:34:50 +00:00
marctagstructure.pl Bug 11771 - Use validation plugin when creating new MARC framework tag 2014-02-19 00:03:24 +00:00
matching-rules.pl Bug 7475: Teach matching rules to handle authorities 2012-09-19 17:15:56 +02:00
oai_set_mappings.pl Bug 9295: Introduce operator equal/ notequal to OAI set mapping instead of hardcoded 'equal' value. 2013-10-10 23:03:30 +00:00
oai_sets.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
patron-attr-types.pl Bug 7919 : Display of values depending on the connexion library 2012-12-05 10:10:57 -05:00
preferences.pl Bug 11135: (follow-up) improve testing of OVERRIDE_SYSPREF_NAMES 2013-10-31 14:21:25 +00:00
printers.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
smart-rules.pl Bug 8365: Add a renewal duration in the issuing rules 2013-03-22 07:56:59 -04:00
stopwords.pl bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions 2012-07-23 10:43:59 +02:00
systempreferences.pl Bug 9760: Simplify local use preferences 2013-03-13 08:56:30 -04:00
transport-cost-matrix.pl Bug 11531: make it possible to edit transport cost for a new libraries 2014-03-12 18:01:43 +00:00
z3950servers.pl Bug 10096 - Add a Z39.50 interface for authority searching 2013-10-04 14:26:29 +00:00