Search code examples
phpcsvfputcsveuro

euro sign from php to csv shows Â


I´m having trouble with the output to a csv file with the euro sign. i´ve tried using € which doesn´t work and the &euro which also doesn´t work. This only works in my table view but not when exported to csv.

Hopes someone could help me out.

UPDATE: I forgot to say that what shows instead of the eurosign is this symbol: Â

'€ '

Solution

  • Old thread but I am answering it anyway for anyone finding this thread via a search engine.

    What really worked for me is the following conversion:

    echo iconv("UTF-8", "CP1252", $csv);
    

    No encoding headers oder other conversions needed, just use the Symbol "€". This has been working since Office 2000 or earlier and still works with Office 2016/365.