Skip to content

Weird character when export subscribers list

dear Sendy support,

My Sendy install:

  • version 1.1.6.3
  • charset = 'utf16' (because i using Vietnamese)

In Sendy tools, character display ok, like "Trực", "Hà"...

But when I saw in phpmyadmin, table "subscribers" show strange character like Trá»±c, HÃ. Or I export that subscribers list, in cvs file, i still saw that strange character.

I want to when export subscribers list, I saw exactly what i see in Sendy tool

Wait for help

Thanks

Trực

Comments

  • BenBen
    edited June 2013

    Hi Trực,

    Strange, I cannot reproduce this problem. I changed my $charset in /includes/config.php to "utf16". Then added 2 subscribers with Vietnamese characters as their names.

    I exported the CSV and here's the result:

    Ben

  • hi Ben,
    in my MySQL tables, Collation is latin1_swedish_ci. Is that normal?

    Maybe i re-install Sendy???

    Trực

  • hi Ben,

    I manual change collation of table subscribers.name to utf8_general_ci. After that, i input "Trực", "hà" then in phpmyadmin, show exactly "Trực", "Hà". I export in csv, that characters is OK.

    Maybe I will manual change collation in mysql ???

    I think Sendy should be set default collcation is utf8_general_ci

    Wait for feedback

    Trực

  • Hi Trực,

    I've made some minor changes to the installation script and re-uploaded a new build to the server. Can you please download Sendy from http://sendy.co/get-updated and re-install? Remember to remove all tables from your database then re-install.

    Thanks.

    Ben

  • hi Ben.
    I just buy Sendy and using latest version 1.1.6.3. I also re-install Sendy (with remove all tables), and re-test. BUT still have strange characters

    Trực

  • hi Ben. I just buy Sendy and using latest version 1.1.6.3. I also re-install Sendy (with remove all tables), and re-test.

    I just made some minor changes by changing the default encoding of the tables to utf8 after you bought. Hence I mentioned re-downloading then re-installing. Or, you can try manually changing your tables encoding to utf8 like you mentioned.

  • hi Ben,
    i think i find something interested, in file s\sendy\includes\subscribers\export-csv.php

    line 99, i changed
    print "$data";
    to
    print chr(255) . chr(254) . mb_convert_encoding($data, 'UTF-16LE', 'UTF-8');

    Everything will be OK when show in excel

    http://stackoverflow.com/questions/4348802/how-can-i-output-a-utf-8-csv-in-php-that-excel-will-read-properly

    Trực

  • Hi Trực,

    Thanks for the findings. The thing is I could export a CSV with Vietnamese characters displayed correctly though. So I won't be implementing this code, but I'm sure it'll help someone else who may have the same issue as you.

    Thanks.

    Ben

This discussion has been closed.