Koha-clms/admin
Tomas Cohen Arazi 59036877f2 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>
(cherry picked from commit 40d3800cc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2014-06-12 10:20:18 +02:00
..
searchengine/solr
…
admin-home.pl
…
aqbudget_user_search.pl
…
aqbudgetperiods.pl
…
aqbudgets.pl Bug 11166: make library filter in funds administration page more precise 2013-12-30 10:53:01 +01:00
aqcontract.pl
…
aqplan.pl
…
auth_subfields_structure.pl Bug 11286: fix bug preventing adding a new subfield to an authority framework 2013-12-13 15:20:31 +01:00
auth_tag_structure.pl Bug 11767 - Use validation plugin when creating new authority framework tag 2014-05-19 16:49:21 +02:00
authorised_values.pl
…
authtypes.pl
…
biblio_framework.pl
…
branch_transfer_limits.pl
…
branches.pl
…
categorie.pl Bug 11513: fix log warning noise in patron category editor 2014-04-23 19:31:28 +02:00
check_budget_parent.pl
…
check_parent_total.pl Bug 11675: check allocated total correctly when editing a fund that has a parent fund 2014-05-27 17:57:35 +02:00
checkmarc.pl
…
cities.pl
…
classsources.pl
…
clone-rules.pl
…
currency.pl
…
didyoumean.pl
…
env_tz_test.pl
…
fieldmapping.pl
…
import_export_framework.pl Bug 9114: Make frameworks import/export routines correctly use UTF-8 2014-06-12 10:20:18 +02:00
item_circulation_alerts.pl
…
itemtypes.pl Bug 11163: display correct itemtype usage count when deleting an itemtype 2013-11-15 15:34:33 +00:00
koha2marclinks.pl
…
marc_subfields_structure.pl Bug 8018: (followup) make the default more explicit 2014-01-16 17:53:44 +01:00
marctagstructure.pl Bug 11771 - Use validation plugin when creating new MARC framework tag 2014-05-19 16:39:15 +02:00
matching-rules.pl
…
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
…
patron-attr-types.pl
…
preferences.pl Bug 11135: (follow-up) improve testing of OVERRIDE_SYSPREF_NAMES 2013-10-31 14:21:25 +00:00
printers.pl
…
smart-rules.pl
…
stopwords.pl
…
systempreferences.pl
…
transport-cost-matrix.pl Bug 11531: make it possible to edit transport cost for a new libraries 2014-06-12 09:19:17 +02:00
z3950servers.pl Bug 10096 - Add a Z39.50 interface for authority searching 2013-10-04 14:26:29 +00:00