Note to tFPFD: Once you use it, it creates a few PHP and DAT files in folder **unifont**. Delete them before uploading to the internet. They will contain hardcoded paths to fonts and must be recreated.
**Export (not only GridView) to CSV in UTF-8 without extensions **
---
I will describe how to easily export GridView into CSV so that filers and sorting is kept. I do not use any extentions which are so famous today.
Note that GridView is not needed, I just want to show the most complicated situation.
Let's say you have page on URL user/index and it contains GridView where you can list and filter users.
> Note: In class yii\data\Sort, in method getAttributeOrders(), is the sorting parameter takem from Yii::$app->getRequest() so the name of the sorted column must be in the URL you are using at the moment. This is why sorting might not work if you want to run UserSearch->search() manually without any GET parameters available in Yii::$app->request->queryParams.
The basic method for exporting DataProvider is here:
```php
public function exportDataProviderToCsv($dataProvider) {
// Setting infinite number of rows per page to receive all pages at once
$dataProvider->pagination->pageSize = -1;
// All text-rows will be placed in this array.
// We will later use implode() to insert separators and join everything into 1 large string