Jump to content

CSV files and DOS ASCII charset


valvet

Recommended Posts

Hi

 

I'm trying to import the data from here: http://188.40.183.103/temp_dont_delete/LagKarLagPris.txt

 

It's a Microsoft C5 dump of products. Acording to the developer who dumped it, it's charset is DOS ASCII - I've tried all the iconv conversations I can think of, to no avail. I still get weird characters instead of æø and å. If you look at it in your browser, you'll also notice it failing to decode it properly.

 

57-8302-Rosa-98/104;Bomulds undertr›je k/‘, 3

 

Should be

 

57-8302-Rosa-98/104;Bomulds undertrøje k/‘, 3

 

$data = file_get_contents('./LagKarLagPris.txt');
$cols = 73;
$delim = ';';
$data = array_chunk(str_getcsv($data, $delim), $cols);

foreach ($data as $key => $val)
{
  // $val[2][1] is the product title
  foreach (mb_list_encodings() as $chr)
    print mb_convert_encoding($val[2][1], 'UTF-8', $chr) . " : $chr\n";
}

 

Any ideas? Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.