CRM-9103 Umlaut broken in exported CSV file

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.4.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      All german umlauts like ä, ö, ü are broken in the exported csv file. ö is shown as ö for instance.

        Attachments

          Activity

          [CRM-9103] Umlaut broken in exported CSV file
          Donald A. Lobo added a comment -

          Please discuss this on forum. Pleaase ensure you are using a spreadsheet like libre office that understands utf-8. I think there are some issues with MS Office and utf-8

          Reto Stauss added a comment -

          All I found in the forums is about importing from XLS and how to save it correctly.

          Also LibreOffice/OpenOffice does not recognize the file as utf-8. It has to be chosen manually (at least I have a choice .

          I think that LibreOffice/OpenOffice does taken into account the byte-order-mark (BOM, http://en.wikipedia.org/wiki/Byte_order_mark). If the csv file exported out of CiviCRM had this it would be opened without asking for a charset. And probably aslo the newer versions of ms excel would be able to handle this.

          Maybe this is more a feature request then ...

          Ollea added a comment -

          To make Excel understands that the file is in UTF-8 a BOM must be present at the beginning of the file, this patch does the trick :

          — Excel.php 2012-10-31 18:12:27.734300341 +0100
          +++ Excel.new.php 2012-10-31 18:09:54.000000000 +0100
          @@ -70,7 +70,7 @@
          if ($outputHeader) {
          // need to add PMA_exportOutputHandler functionality out here, rather than
          // doing it the moronic way of assembling a buffer

          • $out = trim(substr($schema_insert, 0, -1)) . $add_character;
            + $out = chr(239).chr(187).chr(191) . trim(substr($schema_insert, 0, -1)) . $add_character;
            if ($print) { echo $out; }

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Reto Stauss

              Dates

              • Created:
                Updated:
                Resolved: