Skip to content

Commit

Permalink
Document set_encoding method
Browse files Browse the repository at this point in the history
  • Loading branch information
ppetrov committed Nov 8, 2017
1 parent 76a70e2 commit 56d3736
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,24 @@ Array
)
```

#### `set_encoding($encoding)`

Set the encoding of the CSV file.
This is needed, so it can be properly converted to utf-8

Example:

```php
use \Carbon_CSV\CsvFile as CsvFile;
use \Carbon_CSV\Exception;

$csv = new CsvFile('path-to-file/filename.csv');
$csv->set_encoding('windows-1251');
$total_number_of_rows = $csv->count();
```

This will

#### `count()`

Get the total number of rows in the CSV file (this skips the empty rows):
Expand Down

0 comments on commit 56d3736

Please sign in to comment.