mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 00:36:38 +00:00
New feature: unparse now also understands $use_mb_convert_encoding
This commit is contained in:
12
src/Csv.php
12
src/Csv.php
@@ -832,7 +832,17 @@ class Csv {
|
||||
}
|
||||
|
||||
if ($this->convert_encoding) {
|
||||
$string = iconv($this->input_encoding, $this->output_encoding, $string);
|
||||
/** @noinspection PhpComposerExtensionStubsInspection
|
||||
*
|
||||
* If you receive an error at the following 3 lines, you must enable
|
||||
* the following PHP extension:
|
||||
*
|
||||
* - if $use_mb_convert_encoding is true: mbstring
|
||||
* - if $use_mb_convert_encoding is false: iconv
|
||||
*/
|
||||
$string = $this->use_mb_convert_encoding ?
|
||||
mb_convert_encoding($string, $this->output_encoding, $this->input_encoding) :
|
||||
iconv($this->input_encoding, $this->output_encoding, $string);
|
||||
}
|
||||
|
||||
return $string;
|
||||
|
||||
Reference in New Issue
Block a user