You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

PHP file encoding for french accents

Received Response
6
Views
2
Comments
edited Feb 22, 2016 3:31PM in Integrations and APIs 2 comments

Content

Hi,

I have a script that currently encodes a csv file to UTF-8:

   // CONVERT ALL TO UTF-8
    $file = "/tmp/contact_import/data/Contact_Data_".date("dmY").".csv";
    file_put_contents($file, utf8_encode(file_get_contents($file)));
    // CONVERSION COMPLETE

I want to change this encoding to Western Europe (Windows), is there a function for this or would I just use the following:

   // CONVERT ALL TO Windows-1252
    $file = "/tmp/contact_import/data/Contact_RN_Data.csv";
    $file = mb_convert_encoding($file, 'Windows-1252');
    // CONVERSION COMPLETE

Thanks!

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!