PHP Classes
elePHPant
Icontem

real life use case

Recommend this page to a friend!

      PHP Convert CSV to UTF-8  >  All threads  >  real life use case  >  (Un) Subscribe thread alerts  
Subject:real life use case
Summary:when to use this converter
Messages:3
Author:adriano ghezzi
Date:2019-02-05 15:16:16
 

 


  1. real life use case   Reply   Report abuse  
adriano ghezzi - 2019-02-05 15:16:16
Hi Peyman just for my curiosity can You show me a real life use case of the class ?

I mean:
If source file is already in UTF-8 there is no need for conversion as you stated.

if source file is not in UTF-8 it should or could not contains characters in UTF-8

if in any case it contains any UTF-8 characters
the converted file would be the same as source.

Thankyou for your explanation.



  2. Re: real life use case   Reply   Report abuse  
peyman - 2019-02-06 06:54:15 - In reply to message 1 from adriano ghezzi
hi Adriano, glad you asked, this class is not checking for the file format it checks every column format in CSV file using it string so if there is a column with characters that are not formatted with UTF-8 it will convert it then replace it in CSV. the result of it is a UTF-8 CSV file. the problem with CSV file is that sometimes when you want to insert it to the DB if there is a none UTF-8 character in one of the columns it will despair in the result or your progress will fail.

  3. Re: real life use case   Reply   Report abuse  
peyman - 2019-02-06 07:47:04 - In reply to message 1 from adriano ghezzi
sorry my mistake I can't edit the my reply, the class is checking the file format then converting each column to utf-8