Jump to content

Werid csv encoding, strlen returns twice length it should


NeilWalden

Recommended Posts

Hi, I'm using fgetcsv to read a csv file and cycle through it but I think the file is in a weird encoding. When I run strlen on any of the values it returns twice the length minus 1 that it should (e.g. for a string of length 5 it returns 9). Any ideas what it might be and how I can convert them to 'normal' encoding so I can do some string comparisons. I have tried truncating the strings with substr and can see that the extra length is per character rather than extra padding at the start end. Any help much appreciated it's been driving me crazy!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.