Problem/Motivation

There is no way to open a UTF-8 csv file correctly with Excel on UNIX and Windows.

As reported here:
http://stackoverflow.com/questions/6588068/which-encoding-opens-csv-file...

This is the same issue for Drupal 8 as reported for Drupal 7.

Proposed resolution

I propose that the views interface provides an option to include signature (BOM) in the CSV data export.
Include signature BOM option (screenshot)

Remaining tasks

Reviews needed, tests to be written and run.

User interface changes

There is a new option in the CSV style options in the views interface that provides an option to include signature (BOM) in the CSV data export.

API changes

Data model changes

Original report by crystal_alexandre_froger (Drupal 7)

CSV export UTF-8 & windows - BOM (for Drupal 7)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Juterpillar created an issue. See original summary.

Juterpillar’s picture

I've attached a patch.
Please note this patch requires the patch from Support UTF-8 signature in export to work.

Juterpillar’s picture

I've attached another patch (messed up the last one, sorry!).
Please note this patch requires the patch from Support UTF-8 signature in export to work.

Juterpillar’s picture

matthewmessmer’s picture

Status: Active » Reviewed & tested by the community
matthewmessmer’s picture

Patch #4 fixed this issue for me.

undertext’s picture

+1 RTBC
Patch looks good.

hgoto’s picture

I also tested the patch #4 with the patch #2859030-1: Support UTF-8 signature in export and it works well for me. Thank you.

khiminrm’s picture

Patch from #4 works for me. Thanks!

dpi’s picture

Assigned: Juterpillar » Unassigned

There should probably be an entry in defineOptions

Otherwise, thanks, the patch looks good

dpi’s picture

Status: Reviewed & tested by the community » Needs work
Juterpillar’s picture

Thanks dpi,

I've updated the patch to include an entry in defineOptions.

Juterpillar’s picture

Status: Needs work » Needs review
jibran’s picture

Status: Needs review » Reviewed & tested by the community

The module is still in beta so I don't think we need an upgrade path for this change other than that changes looks good to me.

  • jhedstrom committed c5aceb1 on 8.x-1.x authored by Juterpillar
    Issue #2859342 by Juterpillar, dpi, matthewmessmer, undertext, hgoto,...
jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.