• Resolved Chris Yau

    (@chris-yau)


    Hi,

    The export to csv seems not support unicode or UTF-8, some char not showing correct in experted csv file BUT shows correct in exported Excel and PDF.

    BTW, I notice that the plugin haven’t update for a certain period, does this plugin support latest WordPress and WooCommerce? or does this plugin will keep on enhance and develop or even will have pro version?

    Many thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author thehowarde

    (@thehowarde)

    As far as I know, it still works. The method used is independent of changes to WooCommerce, since the query needed to get this info doesn’t really use standard WP_Query.

    The CSV export uses the “DataTables” plugin for jQuery https://datatables.net/

    I’ll check to see if specifying the export type as UTF-8 has any negative repercussions. In the meantime, if you’re comfortable making this change yourself (to see if it resolves for you) – then you could go into /list-backorders-for-woocommerce/js/wc-list-backorders.js on line 26 update to this:

            {   
                extend: 'csv',
                title: dd_backorders.report_title,
                charset: 'UTF-8',
            },
    
    Thread Starter Chris Yau

    (@chris-yau)

    Just checked with updated code but not work, some char still not showing correct and same as on exported Excel file.

    Many thanks

    Plugin Author thehowarde

    (@thehowarde)

    I’ll take a look over the next few days and see if I can figure out something else.

    Thread Starter Chris Yau

    (@chris-yau)

    Hi, any update? Thanks

    Plugin Author thehowarde

    (@thehowarde)

    Hi @chris-yau – to be honest, I forgot about this.

    I’ve updated the plugin and added a filterable Charset for the report.

    You can use the following code in your theme or child theme’s functions.php to alter it.

    add_filter(
    	'dd_list_backorders_report_charset',
    	function() {
    		return 'your-charset-here';
    	}
    );
    Thread Starter Chris Yau

    (@chris-yau)

    Hi @thehowarde,

    I have updated to latest ver 2.3 and added above code snippets but still cannot fix my problem.

    I have products with ® (Copyright sign in html) in product title, however when export to PDF and Excel have no problem, the Copyright sign show in the files correctly but only the cvs export cannot show the “Copyright” sign correctly.

    When I open the cvs in notepad the “Copyright” sign shows correctly but when the csv open in Excel application, the Copygith sign becomes “簧”. I think this is the Excel issue may be caused by your plugin.

    Thanks

    Plugin Author thehowarde

    (@thehowarde)

    Hi @chris-yau – As stated before, the CSV Export from the datatables is using the jQuery Datatables and I’ve not only updated the default content type to UTF-8, but I’ve also made the content type filterable. It seems to me that since what you’re trying to do works with XLS or PDF, then you could use the XLS export, since you’re opening in Excel anyway?

    Thread Starter Chris Yau

    (@chris-yau)

    I open the csv files using Excel directly by double click.
    I found that if I use text editor to open the downloaded csv report, the copyright sign show correctly but only has issue when open it directly in Excel.
    I am now solve by using import data from text files feature in Excel to solve.

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘export csv file not unicode or UTF-8’ is closed to new replies.